title: php imagecopy not working with gif images
body: <p>I am using this code to water mark an image and then save it water marked. The problem when I try to watermark a gif image the I am getting only the first frame of that gif. </p>
  
  <pre><code>imagecopy(
     // source
     $main_image,
     // destination
     $logoImage,
     // destination x and y
     $imageWidth-$logoWidth, $imageHeight-$logoHeight,
     // source x and y
     0, 0,
     // width and height of the area of the source to copy
     $logoWidth, $logoHeight);
      if($type == "png"){imagepng($main_image, $new_path);}
      if($type == "jpeg"){imagejpeg($main_image, $new_path);}
      if($type == "gif"){imagegif($main_image, $new_path);}
  </code></pre>
  
  <p>How do I fix this problem ?</p>