[thelist] detect animated .gif

Bob Meetin ontheroad at frii.com
Thu Jun 21 00:29:23 CDT 2007


now it's been tested - i used the one off phpbuilder:

|$frames = exec("identify -format '%n' theimage.gif");
if ($frames>1) {print "This is an Animation!"; exit;}


it works perfectly - what gives is i'm setting up a site where folks can 
upload images, buddy icons, etc. I will use convert to resize them.  
Earlier I found some 'convert' code that will resize an animated .gif 
and not make it split into separate layers. With the ability to test the 
file first, I can use the leaner version on single layer images.

this is great.  thanks to both of ya. -bob


|Max Schwanekamp wrote:
>> I have some upload scripts that use ImageMagick/convert to resize
>> images after uploaded.  Seems that uploading an animated .gif creates
>> problems.  Is there a php or unix/linux system command that I can use
>> to check the image before attempting to resize?  -Bob
>>     
>
> Untried but ImageMagick seems to be the ticket:
>
> http://forums.devshed.com/php-development-5/is-the-gif-animated-144313.html
> http://www.phpbuilder.com/board/showthread.php?t=10208233 
>
>   





More information about the thelist mailing list