Wed 23 Jul 2014 10:36:49 PM UTC, comment #3:
I have already discussed this with Andy on IRC. Basically the problem is on is_indexed function in _magick__read_.cc file
http://hg.savannah.gnu.org/hgweb/octave/file/c6b89c4a9e63/libinterp/dldfcn/__magick_read__.cc#l75
The file is an indexed image but is_indexed() seems to return false when using older version of GraphicsMagick. This is a problematic function because of the reasons listed on the source (basically, GM does not really tells anything about the file, only about how it is stored in memory after reading and optimizing).
GM uses libpng to read png files, so we access it's values directly to really check if the file is indexed. If the value of "color type orig" is 3, it is an indexed image. I do not know why this is failing on older versions of GM but you can check by running the following:
+verbose+
$ gm identify -verbose default.img | grep -P "Class|IHDR"
Class: PseudoClass
Png:IHDR.color-type-orig: 3
Png:IHDR.bit-depth-orig: 8
-verbose-
If you do not have the "Png:IHDR.color-type-orig", then run the command without grepping and look for something similar to it.
The whole point of using GM is ignoring the underlying library that is actually doing the reading. If we have to start checking things like this for every format, then GM starts losing its value (which in my opinion is already quite low for many other reasons I stated in other bug reports and mailing list).
The GraphicsMagick version where this bug appears is still on Debian stable (which we should be supporting). It also did not exist before 3.8 when default.img was not really an image but an Octave data file so it could be considered a regression.
|