Help - I can't create jpegs with GD
| From: | Cherie Benoit | Date: | Fri, 02 Mar 2001 05:46:28 +0000 |
| Subject: | Help - I can't create jpegs with GD | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-42296@lists.php.net to get a copy of this message | ||
I can't create or manipulate jpegs, but pngs work fine. I am using a hosting
service. They installed GD 1.8.4 with jpeg support a few days ago, but I'm
thinking they did it wrong. I'm using code I know works because it's
straight out of the PHP Cookbook. What do I need to tell them to correct the
problem?
phpinfo() tells me this:
'./configure'
'--with-gd=/opt/local/src/gd-1.8.4'
'--with-config-file-path=/usr/local/lib'
'--with-ttf=/opt/local/src/freetype-1.3.1'
'--with-jpeg-dir=/opt/local/src/jpeg-6b'
'--libdir=/usr/local/lib/'
This is the code I've tried:
<?php
header("Content-type: image/jpeg");
if (($im = ImageCreateFromJpeg("test.jpeg")) == "") {
echo "error opening file";
exit;
}
$red = ImageColorAllocate($im, 255, 0, 0);
ImageString($im, 3, 20, 10, "Hi", $red);
ImageJpeg($im);
?>
Thanks!
--
Cherie Benoit