I have a image upload script that uploads images and renames all files and give it a .jpg extension. I'm using GD Library, which creates thumbnails. For the most part, it works. The problem arises when an animated GIF is uploaded. The image uploads fine and the file is renamed with .jpg extension and you can view the file as normal. The issue comes into play when the thumbnail is generated, it creates 1-200 thumbnails. Here's an example: THIS IS THE NORMAL PROCESS: Actual Image File Uploaded: abc.jpg Renamed by Script and Stored on Server: 1.jpg Thumb Create by GD Library: 1-85x66-filled-enlarged.jpg PROBLEM AREA: Actual Image File Uploaded: abcD.gif Renamed by Script and Stored on Server: 2.jpg Thumb Create by GD Library: (this will result in the following thumbs anywhere from 1-200 thumbs) 2-85x66-filled-enlarged-0.jpg 2-85x66-filled-enlarged-1.jpg 2-85x66-filled-enlarged-2.jpg 2-85x66-filled-enlarged-3.jpg 2-85x66-filled-enlarged-4.jpg But it doesn't create 2-85x66-filled-enlarged.jpg, this is the file the script looks to display. Any ideas on why this happens and how to correct it?
Hmmm, that didn't occur to me, but you might be right. That would explain why it would create somewhere between 1-200 thumbs. Any way to fix that? Good catch!!!
Yeh, I think HiTec is correct each frame within the gif going through the process. use the GIFEncoder class in GD
Well when you convert an animated GIF to a JPEG, your not expecting for it to be animated still are you?