Problems in IE with created gifs

This is a discussion on Problems in IE with created gifs within the PHP Language forums, part of the PHP Programming Forums category; Hello everyone, Wondering if anyone else has had problems with gifs created by php or if anyone sees a problem ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-21-2004
jerrygarciuh
 
Posts: n/a
Default Problems in IE with created gifs

Hello everyone,

Wondering if anyone else has had problems with gifs created by php or if
anyone sees a problem with this code.

Symptom: created jpegs work fine and created gifs work fine in Netscape and
Firefox and when directly viewed.

IE displays gif fine *via internet* BUT off of a CD or local HTML file it
won't display the file.

I have run a dozen gifs through the process and it has happened to every one
of them.

Any advice?

TIA,

jg


function thumbnail ($src_file, $path) {
$orig = $path . '/' . $src_file;
list($w,$h,$type) = getimagesize($orig);
if ($type == 2) { // jpeg
$src_img = imagecreatefromjpeg("$orig");
$name = "thmb_" . $src_file;
$thmb_and_path = $path . $name;
if(!file_exists($thmb_and_path)) {
$image_info = getimagesize($orig);
$src_width = $image_info[0];
$src_height = $image_info[1];
$dest_height= 80;
$dest_width = ($dest_height/$src_height) * $src_width;
$quality = 30;
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,
$dest_height, $src_width, $src_height);
imagejpeg($dst_img, $thmb_and_path, $quality);
chmod("$thmb_and_path", 0777);
imagedestroy($src_img);
imagedestroy($dst_img);
}
} else if ($type == 1) { // gif
$src_img = imagecreatefromgif("$orig");
$name = "thmb_" . $src_file;
$thmb_and_path = $path . $name;
if(!file_exists($thmb_and_path)) {
$image_info = getimagesize($orig);
$src_width = $image_info[0];
$src_height = $image_info[1];
$dest_height= 80;
$dest_width = ($dest_height/$src_height) * $src_width;
$quality = 30;
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,
$dest_height, $src_width, $src_height);
imagejpeg($dst_img, $thmb_and_path, $quality);
chmod("$thmb_and_path", 0777);
imagedestroy($src_img);
imagedestroy($dst_img);
}
}
return $thmb_and_path;
}


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0