1

Before I explain, you may want to take a quick look at my thumbnail generation code: http://pastebin.com/XAPPcUyZ


I pass several image types through this script: jpeg,jpg,gif,png

All types create a 220px wide thumbnail like they should, the problem arrises when the script runs into an animated .gif image - when attempting to make a thumbnail for the gif it outputs something like this: https://i.stack.imgur.com/ZChpI.gif where the image appears tiled when a proper thumbnail should look more like this: http://whatimg.com/i/mhsnf4_thumb.gif.

If I remove 'interlace -line' the animated gif's generate thumbnails without any issue, however I would like to leave this in so that the other file formats are interlaced for faster loading. Is there a way to run interlace without breaking animated gifs like this? If there isn't how can I go about detecting if a gif is animated and running a non-interlaced convert on it instead?

Josh Mountain
  • 1,888
  • 10
  • 34
  • 51
  • http://stackoverflow.com/questions/280658/can-i-detect-animated-gifs-using-php-and-gd and http://stackoverflow.com/questions/1412529/how-do-i-programmatically-check-whether-a-gif-image-is-animated – HamZa Oct 07 '12 at 11:43
  • @HamZaDzCyberDeV The first post you linked uses GD and not ImageMagick, the second one is about a Python script; I don't think either of them answer the question I asked. – Josh Mountain Oct 07 '12 at 13:19
  • In the first link, the second answer is without GD :) It reffers to http://www.php.net/manual/en/function.imagecreatefromgif.php#88005 and the second link is with python i know, but you could install python ? – HamZa Oct 07 '12 at 13:43

0 Answers0