GraphicsMagick: coders/topol.c Improve header debug info.

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.11688.1682871127.1830.graphicsmagick-commit@lists.sourceforge.net>
changeset 805904a49687 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=805904a49687
summary: coders/topol.c Improve header debug info.

diffstat:

 coders/topol.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 137bb560a079 -r 805904a49687 coders/topol.c
--- a/coders/topol.c	Sun Apr 30 17:59:20 2023 +0200
+++ b/coders/topol.c	Sun Apr 30 18:11:46 2023 +0200
@@ -283,6 +283,22 @@
 }
 
 
+static const char *ExplainFileType(magick_uint16_t FileType)
+{
+  switch(FileType)
+  {
+    case 0: return "binary";
+    case 1: return "8 bits gray";
+    case 2: return "8 bits + PALETTE";
+    case 3: return "4 bits gray";
+    case 4: return "4 bits + PALETTE";
+    case 5: return "24 bits RGB";
+    case 6: return "16 bits";
+    case 7: return "32 bits";
+  }
+  return "Unknown - invalid";
+}
+
 static void LogHeaderTopoL(RasHeader *pHeader)
 {
  if(pHeader==NULL) return;
@@ -290,14 +306,14 @@
                         "TopoL Header:\n"
                         "    Rows:		%u\n"
                         "    Columns:		%u\n"
-                        "    FileType:		%u\n"
+                        "    FileType:		%u %s\n"
                         "    Zoom:		%u\n"
                         "    Version:		%u\n"
                         "    Compression:	%u\n"
                         "    Status:		%u",
                                pHeader->Rows,
 			       pHeader->Cols,
-                               pHeader->FileType,
+                               pHeader->FileType, ExplainFileType(pHeader->FileType),
 			       pHeader->Zoom,
                                pHeader->Version,
 			       pHeader->Komprese,
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.