]> git.imager.perl.org - imager.git/blobdiff - PNG/impng.c
PNG re-work: test results of new and old read handlers
[imager.git] / PNG / impng.c
index 142baae8f636bdefbcb21c24d92ab328a35ce3f8..583a2b7ad474396ebb7aacc6d41917b61b49fe1e 100644 (file)
@@ -618,17 +618,23 @@ get_png_tags(i_img *im, png_structp png_ptr, png_infop info_ptr, int bit_depth)
       i_tags_setn(&im->tags, "i_aspect_only", 1);
     }
   }
-  switch (png_get_interlace_type(png_ptr, info_ptr)) {
-  case PNG_INTERLACE_NONE:
-    i_tags_setn(&im->tags, "png_interlace", 0);
-    break;
-  case PNG_INTERLACE_ADAM7:
-    i_tags_set(&im->tags, "png_interlace", "adam7", -1);
-    break;
-
-  default:
-    i_tags_set(&im->tags, "png_interlace", "unknown", -1);
-    break;
+  {
+    int interlace = png_get_interlace_type(png_ptr, info_ptr);
+
+    i_tags_setn(&im->tags, "png_interlace", interlace != PNG_INTERLACE_NONE);
+    switch (interlace) {
+    case PNG_INTERLACE_NONE:
+      i_tags_set(&im->tags, "png_interlace_name", "none", -1);
+      break;
+      
+    case PNG_INTERLACE_ADAM7:
+      i_tags_set(&im->tags, "png_interlace_name", "adam7", -1);
+      break;
+      
+    default:
+      i_tags_set(&im->tags, "png_interlace_name", "unknown", -1);
+      break;
+    }
   }
 
   /* the various readers can call png_set_expand(), libpng will make