It's been a while since I worked on the GIF support, but I see that this
function get_handle($path_to_primary_image) {
global $lang_image_processor_php;
// Let's use this information to create the handle with which to hold our lovely
// image. The variable $image_handle is the handle that points to the image's
// location in memory. Other handle creating functions are available (wireless
// bitmap, for example), but they are very rarely needed. You can learn about
// them at php.net in the function library. Look under image functions. If you
// desire, you could add these types to the following if-then-else statements.
$source_image_size_and_type = getimagesize ($path_to_primary_image) or die($lang_image_processor_php['file_corrupt']);
$source_image_width = $source_image_size_and_type[0];
$source_image_height = $source_image_size_and_type[1];
$source_image_type = $source_image_size_and_type[2];
if ($source_image_type == "1") {
// The image is a GIF file, which we cannot use due to the Unisys patent.
// The image can be read by GD, but GD cannot create it again. It is
// possible to convert a GIF to PNG format using a command line call to
// the appropriate program (i.e. GIF2PNG), but the installation of this
// program on servers is by no means consistent. Therefore, we will
// forgo GIF support. We will return an error.
cpg_die(CRITICAL_ERROR, $lang_image_processor_php['GD_GIF_Warning'], __FILE__, __LINE__);
doesn't allow GIF images, even though there's a check for gif support in init.inc.php. Shouldn't it be
function get_handle($path_to_primary_image) {
global $lang_image_processor_php;
// Let's use this information to create the handle with which to hold our lovely
// image. The variable $image_handle is the handle that points to the image's
// location in memory. Other handle creating functions are available (wireless
// bitmap, for example), but they are very rarely needed. You can learn about
// them at php.net in the function library. Look under image functions. If you
// desire, you could add these types to the following if-then-else statements.
$source_image_size_and_type = getimagesize ($path_to_primary_image) or die($lang_image_processor_php['file_corrupt']);
$source_image_width = $source_image_size_and_type[0];
$source_image_height = $source_image_size_and_type[1];
$source_image_type = $source_image_size_and_type[2];
if ($source_image_type == "1") {
// The image is a GIF file, which we cannot use due to the Unisys patent.
// The image can be read by GD, but GD cannot create it again. It is
// possible to convert a GIF to PNG format using a command line call to
// the appropriate program (i.e. GIF2PNG), but the installation of this
// program on servers is by no means consistent. Therefore, we will
// forgo GIF support. We will return an error.
if ($CONFIG['GIF_support'] == 1) {
$image_handle = imagecreatefromgif($path_to_primary_image);
} else {
cpg_die(CRITICAL_ERROR, $lang_image_processor_php['GD_GIF_Warning'], __FILE__, __LINE__);
}
imagecreatetruecolor doesn't apply to GIF images. Any time a GIF is written it must be imagecreate. Checks must be put into this file to allow for proper GIF creation. I also noticed the function ImageIsTrueColor is used in this file, but only php >= 4.3.2 supports it.