My old host had PHP v.4.2.1 while my new host has 4.2.3. Is any of the code not supported in the newer version? If not, what could be the problem? if you need more info I'll be glad to give it.
Code: Select all
/*== check size 0=width, 1=height ==*/
if (($imgsizeї0] > 250) || ($imgsizeї1] > 200))
{
/*== temp image file -- use "tempnam()" to generate the temp file name. This is done so if multiple people access the script at once they won't ruin each other's temp file ==*/
$tmpimg = tempnam("/tmp", "MKUP");
/*== RESIZE PROCESS
1. decompress jpeg image to pnm file (a raw image type)
2. scale pnm image
3. compress pnm file to jpeg image==*/
/*== Step 1: djpeg decompresses jpeg to pnm ==*/
system("djpeg $imgfile1 >$tmpimg");
/*== Steps 2&3: scale image using pnmscale and then pipe into cjpeg to output jpeg file ==*/
system("pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50 >$imgfile1");
/*== remove temp image ==*/
unlink($tmpimg);
}-Ace