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

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

[Octave-bug-tracker] [bug #30715] imread fails to read uint16 tif image


From: Jonathan Thomson
Subject: [Octave-bug-tracker] [bug #30715] imread fails to read uint16 tif image
Date: Fri, 03 Sep 2010 03:16:16 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Debian/squeeze (2.30.2-3) Epiphany/2.30.2

Follow-up Comment #11, bug #30715 (project octave):

If GraphicsMagick is compiled with a Quantum Depth of 8 (Q8) then
modulusDepth() will never return a value greater than 8. There is currently no
function in GraphisMagick to get an image's original bit depth. It is normal
behaviour for a 16 bit TIFF to be degraded to 8 bits if GraphicsMagick is Q8.

>>Should Octave's configure script check to see whether the GraphicsMagick
libraries were compiled with 8 or 16 bit quantum depth? If we detect 8 bits,
what should we do? 

I suggest throwing a warning and strongly recommend Q16.

>> ... a patch for _magick_read_.cc so we can have a better error message for
images that GraphicsMagick won't be able to read.
The problem isn't that the image can't be read. The problem is that
GraphicsMagick will happily read images with bit depths greater than the
QuantumDepth and imread returns the lower precision image data without error.
The solution should be for Octave to throw an error if the image can't be read
without lowering it's precision. However the method to determine that
precision will be lost eludes me.

>> Is there a way to give a better error message when 16 bit images can't be
read properly?
My idea was to compare the original bit depth of the image to QuantumDepth
and if bit depth is greater than QuantumDepth then precision has been lost.
However gm has no method to return the images original bit depth.
Graphicsmagick might have some other means of reporting that precision has
been lost, but I'm doubtful it does. Therefore the #if (QuantumDepth > ?)
macros don't do anything and are unnecessary. Including the QuantumDepth in an
error message might be useful but is not necessary.
#include <magick/magick_config.h>
...
error ("__magic_read__: index depths bigger than %d-bit not supported",
QuantumDepth); 



As Octave should undoubtedly be able to read medical and scientific images,
which are often 16 bits, using the Q8 libraries of GraphicsMagick should be
considered unacceptable. Perhaps even Q32 should be required. However, greater
quantum depth results in more resources being used.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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