Forum Moderators: coopster
My code is rather simple. If I change from imagecreatetruecolor to imagecreate, image shows up, but only in 'ugly mode.' In phpinfo(), I saw this under GD support.
GD Support enabled
GD Version bundled (2.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
And here's the code...
<?php
Header("Content-type: image/jpeg");
$orig_image = imagecreatefromjpeg($filename);
list($width, $height, $type, $attr) = getimagesize($filename);
if ($width > 150) {
$ratio = 150 / $width;
$newheight = $ratio * $height; }
else $newheight = $height;
$sm_image = imagecreatetruecolor(150,$newheight) or die ("Cannot Initialize new GD image stream");;
Imagecopyresampled($sm_image,$orig_image,0,0,0,0,150,$newheight,imagesx($orig_image),imagesy($orig_image));
imageJPEG($sm_image);
imagedestroy($sm_image);
imageDestroy($orig_image);
?>
Is there any change from 4.2.2 to 4.3.1 that compromised imagecreatetruecolor() function?
Another thought might be to look through bugs.php.net or to upgrade to 4.3.3 with GD 2.0.15