Hi all,
Having a bit of trouble creating thumbnails. I have no access to jpeg or gif functions in my current PHP build, and cannot change this (shared server).
I am using system commands to create the thumbnails. This code was working perfectly one day, and then for no apparent reason (i promise), it stopped working. The resulting thumbnail image - $id_tn.jpg - was a 0k file.
Any ideas? The code is shown below.
Thanks,
Benji.
CODE:
// save photo
$photo_location = "/home/badders/public_html/dad/photos/".$photo_id.".jpg";
$tn_location = "/home/badders/public_html/dad/photos/".$photo_id."_tn.jpg";
$tmpimg = tempnam("/tmp", "MKPH");
move_uploaded_file($photo, $photo_location);
// create & save thumbnail
//$tnw = 100;
//$tnh = 100;
// use *nix commands to create tn
system("djpeg $photo_location >$tmpimg");
system("pnmscale -xysize 100 100 $tmpimg | cjpeg -smoo 10 -qual 50 >$tn_location");