Update osCommerce 2.2 image thumbnailer routine to work with php 54

Tamamlanmış İlan edilme: Feb 5, 2015 Teslim sırasında ödenir
Tamamlanmış Teslim sırasında ödenir

I have an older release of osCommerce, v. 2.2, which I have updated to run in PHP 5.4...all except for one element. I had installed a modification that resizes and serves up image files according to the size demanded by the page in question. The file iitself is called [url removed, login to view], The modification is called "on the fly auto thumbnailer". I have isolated the problem to this one file, which is "only" 415 lines long. Normally, I could debug this myself. What makes it impossible for me is that this file sends all its output somewhere where I can't see it. Clearly, there are errors of some sort, but I can't see them, so I can't fix them.

This file worked fine on php 5.3, but not on php 5.4.

The task I'm putting to a freelancer is to identify and fix the error that prevents this file from producing the expected results in PHP 5.4.

Of the files submitted below, the one I need to have working is [url removed, login to view], which is a later version of the first file "user submitted" That file, is an extremely early version of [url removed, login to view] which does run properly under php 5.4, but it lacks features added to the later version, such as image chaching. I have tried merging the two bit by bit to discover the error but they are so different, and in the absence of the ability to see error messages, I wasn't able to solve the problem.

I would say that someone who knows php better than I could identify the incompatibility in the file, what was allowed under 5.3 but not under 5.4, and get it running quickly. It is probably one statement, but I can't find it.

The call to this function product_thumb.php looks like this:


// "On the Fly Thumbnailer" using PHP GD Graphics Library by Nathan Welch (v1.5)
// Scales product images dynamically, resulting in smaller file sizes, and keeps
// proper image ratio. Used in conjunction with product_thumb.php t/n generator.
function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

// Trim any trailing spaces from image name. Else getimagesize() will fail.
$src=trim($src);

// Set default image variable and code
$image = '<img src="' . $src . '"';

// Don't calculate if the image is set to a "%" width
if (strstr($width,'%') == false || strstr($height,'%') == false) {
$dont_calculate = 0;
} else {
$dont_calculate = 1;
}

// Do we calculate the image size?
if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) {

// Get the image's information
if ($image_size = @getimagesize($src)) {

$ratio = $image_size[1] / $image_size[0];

// Set the width and height to the proper ratio
if (!$width && $height) {
$ratio = $height / $image_size[1];
$width = intval($image_size[0] * $ratio);
} elseif ($width && !$height) {
$ratio = $width / $image_size[0];
$height = intval($image_size[1] * $ratio);
} elseif (!$width && !$height) {
$width = $image_size[0];
$height = $image_size[1];
}

// Scale the image if larger than the set width or height
if ($image_size[0] > $width || $image_size[1] > $height) {
$rx = $image_size[0] / $width;
$ry = $image_size[1] / $height;

if ($rx < $ry) {
$width = intval($height / $ratio);
} else {
$height = intval($width * $ratio);
}

$image = '<img src="product_thumb.php?img='.$src.'&w='.tep_output_string($width).'&h='.tep_output_string($height).'"';
}

} elseif (IMAGE_REQUIRED == 'false') {
return '';
}
}

// Add remaining image parameters if they exist
if ($width) {
$image .= ' width="' . tep_output_string($width) . '"';
}

if ($height) {
$image .= ' height="' . tep_output_string($height) . '"';
}

if ($params != '') {
$image .= ' ' . $params;
}

$image .= ' border="0" alt=" ' . tep_output_string($alt) . ' "';

if ($alt)
$image .= ' title=" ' . tep_output_string($alt) . ' "';

$image .= '>';

return $image;
}

MySQL OSCommerce PHP

Proje NO: #7095344

Proje hakkında

1 teklif Uzak proje Aktif Feb 6, 2015

Seçilen:

mituld

Hi I work towards providing reliable, relevant and robust IT solutions at most competitive prices to my customers. I ensure 100% customer satisfaction so lets start Thanks

%selectedBids___i_period_sub_7% gün içinde 216%project_currencyDetails_sign_sub_9% %project_currencyDetails_code_sub_10%
(177 Değerlendirme)
7.4

Bu iş için 1 freelancer ortalamada $216 teklif veriyor

insidesoft2

Dear Client, Greeting of the day ahead !!! Thanks for providing us opportunity to place bid over the project and communicate with you. I am a serious bidder here and i have already worked on a similar project befor Daha Fazla

$155 USD in 3 gün içinde
(0 Değerlendirme)
0.0