GraphicsMagick: coders/bmp.c Reverting to BI_BITFIELD. BI_ALPHAB...

GraphicsMagick Commits <[email protected]> Tue, 05 Sep 2023 17:07:41 -0500
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.14621.1693951670.8047.graphicsmagick-commit@lists.sourceforge.net>
changeset 01974c17c2e9 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=01974c17c2e9
summary: coders/bmp.c Reverting to BI_BITFIELD. BI_ALPHABITFIELDS seems to be very rare.

diffstat:

 ChangeLog    |  7 ++++++-
 coders/bmp.c |  5 +----
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 529828e1ae4e -r 01974c17c2e9 ChangeLog
--- a/ChangeLog	Tue Sep 05 10:50:32 2023 -0500
+++ b/ChangeLog	Wed Sep 06 00:07:23 2023 +0200
@@ -1,3 +1,8 @@
+2023-09-06  Fojtik Jaroslav  <[email protected]>
+
+	* coders/bmp.c Reverting to BI_BITFIELD. BI_ALPHABITFIELDS
+	seems to be very rare.
+
 2023-09-05  Bob Friesenhahn  <[email protected]>
 
 	* coders/wmf.c (ipa_draw_text): Treat pointer inputs as if they
@@ -8,7 +13,7 @@
 
 2023-09-05  Fojtik Jaroslav  <[email protected]>
 
-	* coders/bmp.c Sorry for previous commit. After some
+	* coders/bmp.c Sorry for a previous commit. After some
 	investigations it seems that bit field masks are behind header
 	when BI_SIZE=40.
 
diff -r 529828e1ae4e -r 01974c17c2e9 coders/bmp.c
--- a/coders/bmp.c	Tue Sep 05 10:50:32 2023 -0500
+++ b/coders/bmp.c	Wed Sep 06 00:07:23 2023 +0200
@@ -1125,9 +1125,6 @@
         ThrowBMPReaderException(CorruptImageError,NegativeOrZeroImageSize,image);
       if ((bmp_info.height < 0) && (bmp_info.compression !=0))
         ThrowBMPReaderException(CorruptImageError,CompressionNotValid,image);
-      // J.Fojtik - TEST IS DUPLICATED, PLEASE REMOVE!
-      //if (bmp_info.compression>BI_BITFIELDS && bmp_info.compression!=BI_ALPHABITFIELDS)
-      //  ThrowBMPReaderException(CorruptImageError,UnrecognizedImageCompression,image);
       switch ((unsigned int) bmp_info.compression)
         {
         case BI_BITFIELDS:
@@ -2071,7 +2068,7 @@
           bmp_info.number_colors=0;
           bmp_info.bits_per_pixel=((type > 3) && image->matte) ? 32 : 24;
           bmp_info.compression=
-            (type > 3) && image->matte ?  BI_ALPHABITFIELDS : BI_RGB;
+            (type > 3) && image->matte ?  BI_BITFIELDS : BI_RGB;
         }
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                             "Final: Scene %lu, storage_class %s, colors %u",