I would like use some of the GD image functions, so I ran a couple of
short scripts to see if it worked, such as:
<?php
/* Create a red square */
$image = imagecreate(200 , 200);
$colorRed = imagecoloralloc ate($image, 255, 0, 0);
imagefill($imag e, 0, 0, $colorRed);
//send image
header("Content-type: image/jpeg");
imagejpeg($imag e);
?>
but all they generates are garbage characters and no image, starting
with:
ÿØÿàJFIFÿþ >CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
quality ÿÛC ... (etc.)
I then ran a script to see what version was installed
(var_dump(gd_in fo());)and it generated: ["GD Version"]=> string(24)
"bundled (2.0 compatible)"
So why doesn't it generate a jpeg? Am I doing something incorrectly or
is it the library itself? (This is using a hosting account at
godaddy.com. It is not PHP or a GD library that I installed).
Thanks,
Eric
short scripts to see if it worked, such as:
<?php
/* Create a red square */
$image = imagecreate(200 , 200);
$colorRed = imagecoloralloc ate($image, 255, 0, 0);
imagefill($imag e, 0, 0, $colorRed);
//send image
header("Content-type: image/jpeg");
imagejpeg($imag e);
?>
but all they generates are garbage characters and no image, starting
with:
ÿØÿàJFIFÿþ >CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
quality ÿÛC ... (etc.)
I then ran a script to see what version was installed
(var_dump(gd_in fo());)and it generated: ["GD Version"]=> string(24)
"bundled (2.0 compatible)"
So why doesn't it generate a jpeg? Am I doing something incorrectly or
is it the library itself? (This is using a hosting account at
godaddy.com. It is not PHP or a GD library that I installed).
Thanks,
Eric
Comment