ImageJPEG not supported in this build.

From: Date: Wed, 22 Nov 2000 21:24:24 +0000
Subject: ImageJPEG not supported in this build.
Groups: php.general 
Request: Send a blank email to php-general+get-26727@lists.php.net to get a copy of this message
I just recenly upgraded my version of PHP from 3 to 4 (more specificly 4.0.3pl1 on SuSE 6.4). I was going through the examples in the manual and am having problems with the imagejpeg function. I used the example below: --- <? /* ** Attempt to draw a magenta square */ //attempt to open image, suppress error messages if(!($image = @imagecreatefromjpeg("php_lang.jpg"))) { //error, so create an error image and exit $image = imagecreate(200,200); $colorWhite = imagecolorallocate($image, 255, 255, 255); $colorBlack = imagecolorallocate($image, 0, 0, 0); imagefill($image, 0, 0, $colorWhite); imagestring($image, 4, 10, 10, "Couldn't load image!", $colorBlack); header("Content-type: image/jpeg"); imagejpeg($image); exit(); } $colorMagenta = imagecolorresolve($image, 255, 0, 255); // draw a square imagefilledrectangle($image, 10, 10, 50, 50, $colorMagenta); //send image header("Content-type: image/jpeg"); imagejpeg($image); ----------- How ever when I attempt to load this page in Netscape 4.75 I get the broken image. I tried it on IE 5.5 and I get the following message: <b>Warning</b>: ImageJpeg: No JPG support in this PHP build in <b>/home/matth/public_html/imagecolorresolve.php</b> on line <b>16</b><br> How ever the file imagecreatefrompng.php works with no problems. I have checked via ldd the file /usr/lib/apache/libphp4.so and it has been linked against libjpeg (6.2), and libpng (2.0), and I have gdlib 1.7.3 loaded on my system. If I display the phpconfig with the phpinfo() function this is what I see for GD: ------------ GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Package with TTF library PNG Support enabled ------------ Am I correct in assuming that even though the php module has been linkephp from SuSE?d against libjpeg that I can not use the imagejpeg function with this build of Thanks in advance. Matthew p.s. I had searched the php-general mailing list archives and found only one article that came close to my problem. However with that issue they had problems with the imagecreatefromjpeg() function which mine doesn't seem to have a problem with. only the imagejpeg() function.

« previous php.general (#26727) next »