octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42834] imread ("default.img") returns empty c


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #42834] imread ("default.img") returns empty colormap with gm 1.3.16
Date: Wed, 23 Jul 2014 22:36:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 Iceweasel/30.0

Follow-up Comment #3, bug #42834 (project octave):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42834>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]