Page 1 of 2

convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-14T06:16:45-07:00
by dvir
There is a weird behavior I encountered with splitting a GIF into PNG frames.
Using an older version of ImageMagick (6.5.4-7), the command 'convert test.gif gif_frame_%d.png' produces correct files (with 'Format: PNG' when using 'identify -verbose gif_frame_0.png'), while using a newer version (6.8.6-8) with the same command produces files that are 'Format: GIF'.

Is there a parameter I'm missing for the new version, or could it be just a configure variable?

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-14T10:45:58-07:00
by fmw42
Try IM 6.9.0.3 As I recall there was at least one version of IM that had that problem and was quickly fixed. If that does not work, then post your gif image so others can test it. You can upload to some place like dropbox.com and put the URL here. Also post the results of convert -version to see that you have the needed delegates. Also perhaps your libpng is too old or has a bug.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-14T12:39:09-07:00
by dvir
fmw42 wrote:Try IM 6.9.0.3 As I recall there was at least one version of IM that had that problem and was quickly fixed. If that does not work, then post your gif image so others can test it. You can upload to some place like dropbox.com and put the URL here. Also post the results of convert -version to see that you have the needed delegates. Also perhaps your libpng is too old or has a bug.
broken convert -version:

Code: Select all

Version: ImageMagick 6.8.6-8 2014-12-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg png ps xml zlib
working convert -version:

Code: Select all

Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
This happens for *any* GIF, but here is one example: https://www.dropbox.com/s/nsxujjrhwqo7862/test.gif?dl=0

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-14T14:10:02-07:00
by dvir
I've ran it with the newest version:

Code: Select all

Version: ImageMagick 6.9.0-1 Q16 x86_64 2014-11-24 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates (built-in): bzlib xml zlib
And it's also creating files with 'Format: GIF' :(

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-14T16:53:45-07:00
by fmw42
6.9.0.1 is a known bogus version with that exact issue as I mentioned above. The latest version is 6.9.0.3. Post your image somewhere like dropbox.com and put the URL here. Then we can test and see if we can duplicate.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T05:49:53-07:00
by dvir
fmw42 wrote:6.9.0.1 is a known bogus version with that exact issue as I mentioned above. The latest version is 6.9.0.3. Post your image somewhere like dropbox.com and put the URL here. Then we can test and see if we can duplicate.
oh I see :(

The image is here: https://www.dropbox.com/s/nsxujjrhwqo7862/test.gif?dl=0
But it happens for any GIF that I tried so far. Thanks!

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T10:27:57-07:00
by fmw42
This works fine for me on IM 6.9.0.3 Q16 Mac OSX. All gif frames are converted to png

Code: Select all

convert test.gif new/test_%d.png

cd new

identify test_0.png
test_0.png PNG 500x250 500x250+0+0 8-bit sRGB 138c 25.4KB 0.000u 0:00.000
Do you have the libpng delegate and is it current?

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T10:36:35-07:00
by dvir
Is there an easy way to check? It's the same machine that I'm executing the other command on.

I just tried with 6.9.0-0 on my local machine and it's correct as well - PNG format.
Could this issue also be in 6.8.6-8?

My issue is with that version and it's on a server that I don't have direct access to upgrading software on, but I'll try to push for that. Would be nice to verify that it's an issue with 6.8.6-8 and not just another bug/mis-configuration that will be there after the upgrade, though.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T10:50:51-07:00
by fmw42
Perhaps you are missing some other needed delegate, though I have no idea what. Or your libpng delegate is too old or corrupt. Or the IM 6.8.6.8 is corrupt. I am trying to recompile 6.8.6.8 to test. Let you know what happens shortly.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T11:00:53-07:00
by fmw42
Works fine for me with IM 6.8.6.8

Code: Select all

im6868 convert -version
Version: ImageMagick 6.8.6-8 2015-01-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib mpeg fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr lzma openexr png ps rsvg tiff webp x xml zlib

im6868 convert test.gif new/test_%d.png
cd new
identify test_0.png
test_0.png PNG 500x250 500x250+0+0 8-bit sRGB 138c 25.4KB 0.000u 0:00.000

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T11:05:04-07:00
by dvir
thanks for checking! that means I'm back to square one.

So my version of 6.8.6-8 reports this:

Code: Select all

Version: ImageMagick 6.8.6-8 2014-12-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg png ps xml zlib
So the delegate is there. Could it be anything else? Could I figure out which libpng is ImageMagick using? Assuming I might have more than one, because it does work on the same machine with 6.5.4-7.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T11:12:37-07:00
by fmw42
What do you get for delegates from 6.5.4.7.

Try

convert -list configure

and look at the line starting DELEGATES

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T11:14:18-07:00
by fmw42
Try

convert -list format

It might tell you the version as per this on mine


PNG* PNG rw- Portable Network Graphics (libpng 1.6.12)
See http://www.libpng.org/ for details about the PNG format.
PNG00* PNG rw- PNG inheriting bit-depth and color-type from original
PNG24* PNG rw- opaque or binary transparent 24-bit RGB (zlib 1.2.8)
PNG32* PNG rw- opaque or transparent 32-bit RGBA
PNG48* PNG rw- opaque or binary transparent 48-bit RGB
PNG64* PNG rw- opaque or transparent 64-bit RGBA
PNG8* PNG rw- 8-bit indexed with optional binary transparency


Note PNG24 seems to need zlib.

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T11:34:54-07:00
by dvir
oh wow, this is weird: convert -list configure reports this delegates for the working version:

Code: Select all

DELEGATES     bzlib fontconfig freetype gs jpeg jng jp2 lcms png rsvg tiff x11 xml wmf zlib
and this delegates for the broken version:

Code: Select all

DELEGATES      bzlib freetype jng jpeg png ps xml zlib
"convert -list format" shows PNG formats for the working version, but none for the broken version. What could cause that?

(btw, thanks SO much for the help!)

Re: convert produces images of the same type as the input and not the type of the output file

Posted: 2015-01-15T14:34:36-07:00
by fmw42
and this delegates for the broken version:
CODE: SELECT ALL
DELEGATES bzlib freetype jng jpeg png ps xml zlib
PNG seems to be in both systems. However, this list does not always mean that the delegate is really there and working.


You may need to check the versions of each using

convert -list format

If PNG is not listed in the bad IM version, then it was not truly installed properly. Still it could be there an corrupt. So it might need reinstalling and if so, try to upgrade it.