Error with extracting gif frames, and catching the error in python
Posted: 2016-04-05T17:01:14-07:00
I am using Version: ImageMagick 6.9.3-7 Q16 x86_64 2016-04-03
When I attempt to use convert to extract frames for a gif sometimes i get this with corrupt gifs:
convert -coalesce examine.gif video.png
convert: corrupt image `examine.gif' @ error/gif.c/ReadGIFImage/1368.
convert: no images defined `video.png' @ error/convert.c/ConvertImageCommand/3252.
Here is a link to an example image that chokes here:
http://www.image-share.com/upload/3207/277.gif
When I execute it from a subprocess in python - I can't seem to catch the error output:
command = ["convert" , "-coalesce", "-scene" , str(file_counter) , infile, outfile]
output,error = subprocess.Popen(command, universal_newlines=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=r'/home/mvgen/fixgifs').communicate()
Output and Error are generally blank or say NONE.
Anyone have some hints for a work around like this with broken gifs? Identify will give a frame count from even corrupt gifs.
When I attempt to use convert to extract frames for a gif sometimes i get this with corrupt gifs:
convert -coalesce examine.gif video.png
convert: corrupt image `examine.gif' @ error/gif.c/ReadGIFImage/1368.
convert: no images defined `video.png' @ error/convert.c/ConvertImageCommand/3252.
Here is a link to an example image that chokes here:
http://www.image-share.com/upload/3207/277.gif
When I execute it from a subprocess in python - I can't seem to catch the error output:
command = ["convert" , "-coalesce", "-scene" , str(file_counter) , infile, outfile]
output,error = subprocess.Popen(command, universal_newlines=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=r'/home/mvgen/fixgifs').communicate()
Output and Error are generally blank or say NONE.
Anyone have some hints for a work around like this with broken gifs? Identify will give a frame count from even corrupt gifs.