During your project development some time your client ask for thumbnailing of
gif & png. if your hosting support imagemagick then you can easily create thumbnail.
For that Your host must support imagemagick library.

Here is function of creating thumbnail of png jpg gif image using imagemagick.
You need to just pass image name, original filename with path and destination file
name with path where it will save.

Php Script generate thumbnail in destination directory.
<?php
//Function for image resize
function create_thumb($new_width,$original,$thumbnail) {
 
 // Get the size of image
 $arr    = getimagesize($original);
 $width  = $arr[0];
 $height = $arr[1];

 // Determine if the image actually needs to be resized
 // and if it does, get the new height for it
 if ($width > $new_width)
 {
    $aspect_ratio = $new_width/$width;
    $new_height = floor($height*$aspect_ratio);
  
  // Convert the file
  system(”convert -geometry $new_width x $new_height $original $thumbnail”, $res);
  
  if ($res) return false;
    else return true;    
 }
 else {
  //copy image
  copy($original,$thumbnail);
  return true;
 }
}
?>

Calling function using php code.
<?php
//Resize image
create_thumb(100,”product/img1.gif”,”thumbnail/img1.gif”);
?>