imagecreatefromjpeg crash
| From: | Hitek | Date: | Wed, 15 Jan 2003 17:36:19 +0000 |
| Subject: | imagecreatefromjpeg crash | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-131723@lists.php.net to get a copy of this message | ||
Greetings,
I am having a very peculiar problem trying to use imagecreatefromjpeg (indeed, ANY of the imagecreatefrom... functions)
under both Windows and FreeBSD.
First off, here are my server specs:
Win: apache 1.3.23, php 4.2.1, GD 2.0 or better
BSD: apache 1.3.26, php 4.2.3, GD 2.0 or better
And now the problem:
I am trying to use imagecreatefromjpg() to load in an image so that I can copy parts of it to other images. Here;s the code:
$orig = imagecreatefromjpeg('46880_img.jpg');
// initialize the image parts for the email form
$cell1 = imagecreate (468, 29);
$cell2 = imagecreate (231, 25);
$cell5 = imagecreate (468, 26);
//copy the parts of the original banner to the individual cell images
imagecopy($cell1, $orig, 0,0,0,0,468, 29);
imagecopy($cell2, $orig, 0,0,0,29,231, 25);
imagecopy($cell5, $orig, 0,0,0,54,486, 26);
$c1 = imagejpeg ( $cell1, "cell1_img.jpg",80);
$c2 = imagejpeg ( $cell2, "cell2_img.jpg",80);
$c5 = imagejpeg ( $cell5, "cell5_img.jpg",80);
$c7 = imagejpeg ( $orig, "orig_img.jpg",80);
On windows, I get:
"php.exe has generated errors and will be closed by windows".
The apache error log shows:
"Premature end of script headers: f:/nusphere/apache/php/php.exe"
On BSD, I get:
DNS error in IE
Netscape just waits forever.
If I comment out the imagecreatefromjpeg function, the script behaves as expected on both systems:
The imagecopy functions complain that the original image doesn't exist.
Note: I have tried to fopen the image, and use imagecreatefromstring with the exact same results.
Is this a problem with GD?
Is there a workaround?
Thanks,
Keith