about summary refs log tree commit diff
path: root/converter/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-05-15 15:33:36 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-05-15 15:33:36 +0000
commitd4566d57cc0fca7f31aee276b2e1522dd3c455c1 (patch)
treec02a1dffde80e6b37a427ac9f773646c41ded60a /converter/other
parent618539817adc09d31ef6bc16b9d48f4bbc902d35 (diff)
downloadnetpbm-mirror-d4566d57cc0fca7f31aee276b2e1522dd3c455c1.tar.gz
netpbm-mirror-d4566d57cc0fca7f31aee276b2e1522dd3c455c1.tar.xz
netpbm-mirror-d4566d57cc0fca7f31aee276b2e1522dd3c455c1.zip
Fix failure to recognize BLACKANDWHITE_ALPHA
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4103 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r--converter/other/pamtopng.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/converter/other/pamtopng.c b/converter/other/pamtopng.c
index 3a987820..a9d04029 100644
--- a/converter/other/pamtopng.c
+++ b/converter/other/pamtopng.c
@@ -287,6 +287,16 @@ colorTypeFromInputType(const struct pam * const pamP) {
             pm_error("Input tuple type is GRAYSCALE, "
                      "but number of planes is %u instead of 1",
                      pamP->depth);
+     } else if (strneq(pamP->tuple_type, "BLACKANDWHITE_ALPHA", 19)) {
+        if (pamP->depth != 2)
+            pm_error("Input tuple type is BLACKANDWHITE_ALPHA, "
+                     "but number of planes is %u instead of 2",
+                     pamP->depth);
+        if (pamP->maxval != 1)
+            pm_error("Input tuple type is BLACKANDWHITE_ALPHA, "
+                     "but maxval is %u instead of 1", (unsigned)pamP->maxval);
+
+        retval = PNG_COLOR_TYPE_GRAY_ALPHA;
     } else if (strneq(pamP->tuple_type, "BLACKANDWHITE", 3)) {
         if (pamP->depth != 1)
             pm_error("Input tuple type is BLACKANDWHITE, "