Has anyone had problems with IE not showing thumbnailed gifs when Firefox and NN show them fine?

From: jerrygarciuh (designs_at_no.spam.nolaflash.com)
Date: 10/29/04


Date: Fri, 29 Oct 2004 13:59:04 -0500

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;
    }



Relevant Pages

  • Problems in IE with created gifs
    ... Symptom: created jpegs work fine and created gifs work fine in Netscape and ... IE displays gif fine *via internet* BUT off of a CD or local HTML file it ...
    (comp.lang.php)
  • Re: Navigation .gif not visible in .php file
    ... Upon further investigation I notice that the .gifs associated with my .php ... > elements, forms, etc. to a page simply bacause it has a .php extension. ... > At least you'll have a more pleasant experiance viewing and editing the ...
    (microsoft.public.frontpage.client)
  • Re: Navigation .gif not visible in .php file
    ... the .gifs in my Navigation bars are not ... showing up in my .php files. ... It sounds like FP2003 does like publishing the navigation .gifs associated ...
    (microsoft.public.frontpage.client)