Forum Moderators: coopster
//-- RE-SIZING UPLOADED IMAGE
/*== only resize if the image is larger than 250 x 200 ==*/
$imgsize = GetImageSize($imgfile);
/*== check size 0=width, 1=height ==*/
echo $imgsize[0];echo " ";echo $imgsize[1];
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 ==*/
$last_line = system("djpeg $imgfile >$tmpimg", $retval);
echo $last_line." ".$retval." ";
/*== Steps 2&3: scale image using pnmscale and then
pipe into cjpeg to output jpeg file ==*/
$last_line = system("pnmscale -xy 250 200 $tmpimg ¦ cjpeg -smoo 10 -qual 50 >$imgfile", $retval);
echo $last_line." ".$retval." ";
/*== remove temp image ==*/
unlink($tmpimg);
}
It returns 127
127 what?
Have you turned up error_reporting() [php.net] yet to see what, if any, error messages are being returned? How about checking the logs for any errors? I'm guessing it is likely some type of permissions issue for starters ...
Warning: unlink(): SAFE MODE Restriction in effect. The script whose uid/gid is 2850/2850 is not allowed to access /tmp/MKUPC4fean owned by uid/gid 99/99 in /mounted-storage/home10/sub002/sc11883-LGVN/ssl/addpictures.php on line 104
Is this a GUID check?
I am uploading a file via the SSL on my site which moves the file to a folder on the unsecured WWW site.
They are essentially 2 different servers I think.