ImageCreateFromJpeg and ImageJpeg -> GD 1.5

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

  • : 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.

Howdy, Stranger!

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

Categories

In this Discussion