Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
ImageCreateFromJpeg and ImageJpeg -> GD 1.5
i have a script that resizes images that works on a normal server but on one particular server which has a "GD Version 1.5" ((GIF) or earlier, FreeType support, t1lib support) the functions
ImageCreateFromJpeg and ImageJpeg don't work.
Is there a way to make the script work or is there another script that will do the same work with a GD Version 1.5 ??
here is the script;
$id2 = "$id-$idphoto.jpg";
$picdir = "../../photos";
$thumbdir = "../../photos/photo";
$twidth = "150";
$pics = array();
$pdir = opendir($picdir);
$img_info = GetImageSize($picdir . "/" . $id2);
$original = ImageCreateFromJpeg($picdir . "/" . $id2);
$thumbnail = ImageCreate($twidth, $img_info * ($twidth / $img_info));
ImageCopyResized($thumbnail, $original, 0, 0, 0, 0, $twidth, $img_info * ($twidth / $img_info), ImageSX($original), ImageSY($original));
ImageJpeg($thumbnail, $thumbdir . "/" . $id2);
array_push($pics, $thumbdir . "/" . $id2);
0 · ·