diff libinterp/dldfcn/__magick_read__.cc @ 20729:131b4af8b5d8

Only warn of Magick quantum depth if less than 16 instead of 32. * libinterp/dldfcn/__magick_read__.cc: we are currently warning users about limitations of their Magick if it was built with less than quantum depth 32. This is excessive, it is only useful for people with 32 bit images (few and hopefully knowledgeable enough to notice immediately) while scaring all the other users.
author Carnë Draug <carandraug@octave.org>
date Fri, 20 Nov 2015 11:34:22 +0000
parents 571508c1ed06
children c2d9556d51d0
line wrap: on
line diff
--- a/libinterp/dldfcn/__magick_read__.cc	Thu Nov 19 14:39:04 2015 -0800
+++ b/libinterp/dldfcn/__magick_read__.cc	Fri Nov 20 11:34:22 2015 +0000
@@ -713,7 +713,26 @@
       // Restore locale from before GraphicsMagick initialisation
       setlocale (LC_ALL, locale.c_str ());
 
-      if (QuantumDepth < 32)
+      // Why should we give a warning?
+      // Magick does not tell us the real bitdepth of the image in file.
+      // The best we can have is the minimum between the bitdepth of the
+      // file and the quantum depth.  So we never know if the file will
+      // actually be read correctly so we warn the user that it might
+      // be limited.
+      //
+      // Why we warn if < 16 instead of < 32 ?
+      // The reasons for < 32 is simply that it's the maximum quantum
+      // depth they support.  However, very few people would actually
+      // need such support while being a major inconvenience to anyone
+      // else (8 bit images suddenly taking 4x more space will be
+      // critical for multi page images).  It would also suggests that
+      // it covers all images which does not (it still does not support
+      // float point and signed integer images).
+      // On the other hand, 16bit images are much more common. If quantum
+      // depth is 8, there's a good chance that we will be limited.  It
+      // is also the GraphicsMagick recommended setting and the default
+      // for ImageMagick.
+      if (QuantumDepth < 16)
         warning_with_id ("Octave:GraphicsMagic-Quantum-Depth",
                          "your version of %s limits images to %d bits per pixel\n",
                          MagickPackageName, QuantumDepth);