GraphicsMagick: MAT: Add some more useful logging.

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.28336.1640189815.1995.graphicsmagick-commit@lists.sourceforge.net>
changeset d6040593dde5 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=d6040593dde5
summary: MAT: Add some more useful logging.

diffstat:

 coders/mat.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r fd361514b612 -r d6040593dde5 coders/mat.c
--- a/coders/mat.c	Wed Dec 22 09:51:16 2021 -0600
+++ b/coders/mat.c	Wed Dec 22 10:16:43 2021 -0600
@@ -1,5 +1,5 @@
 /*
-% Copyright (C) 2003-2020 GraphicsMagick Group
+% Copyright (C) 2003-2021 GraphicsMagick Group
 % Copyright (C) 2002 ImageMagick Studio
 %
 % This program is covered by multiple licenses, which are described in
@@ -42,6 +42,7 @@
 #include "magick/color.h"
 #include "magick/colormap.h"
 #include "magick/constitute.h"
+#include "magick/log.h"
 #include "magick/magick.h"
 #include "magick/magick_endian.h"
 #include "magick/monitor.h"
@@ -526,6 +527,9 @@
     HDR.nRows = ReadBlobXXXLong(image);
     HDR.nCols = ReadBlobXXXLong(image);
 
+    if (image->logging)
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"MAT v4 %ux%u", HDR.nCols, HDR.nRows);
+
     if (HDR.nRows == 0 || HDR.nCols == 0) RET_CHECK(image);
 
     HDR.imagf = ReadBlobXXXLong(image);
@@ -1088,6 +1092,10 @@
     image->columns = MATLAB_HDR.SizeX;
     image->rows = MATLAB_HDR.SizeY;
     image->colors = 1l << image->depth;
+    if (image->logging)
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"MAT %lux%lu (%u colors)",
+                            image->columns, image->rows, image->colors);
+
     if(image->columns == 0 || image->rows == 0)
       goto MATLAB_KO;
     if((unsigned long)ldblk*MATLAB_HDR.SizeY > MATLAB_HDR.ObjectSize)  /* Safety check for forged and or corrupted data. */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.