Page 2 of 2
Re: header('Content-Type: image/jpeg'); not behaving as I ho
Posted: Thu Jun 11, 2009 9:09 pm
by McInfo
I have a theory. Run this diagnostic script on your localhost. My theory is that the path to bob.png is incorrect or that bob.png does not exist on your localhost. If the diagnostic script generates a black image, my theory is probably correct.
Code: Select all
<?php
$image = imagecreatetruecolor(300, 300);
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
?>
Edit: This post was recovered from search engine cache.
Re: header('Content-Type: image/jpeg'); not behaving as I hoped.
Posted: Fri Jun 12, 2009 3:52 pm
by nickcherryjiggz
Dern. I was really hoping that I was just making a stupid mistake and mis-referencing the image. Unfortunately, not.
I ran this:
Code: Select all
<?php
$image = imagecreatetruecolor(300, 300);
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
?>
And got this:
Code: Select all
The image “http://127.0.0.1:8000/jiggzyquick-startpackage/imagetest.php” cannot be displayed, because it contains errors.
And just for kicks, I also ran this:
Code: Select all
<?php
$image = imagecreatetruecolor(300, 300);
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
And then got this:
Code: Select all
http://127.0.0.1:8000/jiggzyquick-startpackage/imagetest.php
Re: header('Content-Type: image/jpeg'); not behaving as I hoped.
Posted: Fri Jun 12, 2009 4:04 pm
by mikemike
What version of GD lib are you using?
Re: header('Content-Type: image/jpeg'); not behaving as I hoped.
Posted: Fri Jun 12, 2009 4:58 pm
by nickcherryjiggz
Whatever came with the most recent version of MAMP, which looks to be "bundled (2.0.34 compatible)".
And for reference, my phpinfo() printout can be found at this URL:
http://www.jiggzy.com/phpinfo/
All the GD-related things seem to be enabled and it good shape.
Re: header('Content-Type: image/jpeg'); not behaving as I ho
Posted: Fri Jun 12, 2009 9:25 pm
by McInfo
How attached are you to MAMP?
XAMPP for Mac OS X
Edit: This post was recovered from search engine cache.