ImageCreateFromJpeg and ImageJpeg -> GD 1.5 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

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

sekrisekri Posts: 1Member
Hello
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[1] * ($twidth / $img_info[0]));
ImageCopyResized($thumbnail, $original, 0, 0, 0, 0, $twidth, $img_info[1] * ($twidth / $img_info[0]), ImageSX($original), ImageSY($original));
ImageDestroy($original);
ImageJpeg($thumbnail, $thumbdir . "/" . $id2);
ImageDestroy($thumbnail);
array_push($pics, $thumbdir . "/" . $id2);
closedir($pdir);
return ($pics);

Thanks alot
Sekri

Comments

  • Mark StrijbosMark Strijbos Posts: 82Member
    : Hello
    : 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 ??
    :
    AFAIK JPEG (and PNG) support was only introduced in GD when they had to drop the GIF output format.

    and dont forget you also have to "compile in" support for these formats by installing the jpeglib, pnglib and zlib libraries


Sign In or Register to comment.