]> git.imager.perl.org - imager.git/blobdiff - tiff.c
- set i_format to tiff when reading tiff images and test for it
[imager.git] / tiff.c
diff --git a/tiff.c b/tiff.c
index e64fb007ad7c594e6682f11f4186d2181b8dc1f1..89eb4a143a3f06c87fccd5ef782eb0cfe08c89d7 100644 (file)
--- a/tiff.c
+++ b/tiff.c
@@ -163,6 +163,9 @@ static i_img *read_one_tiff(TIFF *tif) {
   else {
     im = i_img_empty_ch(NULL, width, height, channels);
   }
+
+  if (!im)
+    return NULL;
     
   /* resolution tags */
   TIFFGetFieldDefaulted(tif, TIFFTAG_RESOLUTIONUNIT, &resunit);
@@ -195,6 +198,8 @@ static i_img *read_one_tiff(TIFF *tif) {
                 strlen(data), 0);
     }
   }
+
+  i_tags_add(&im->tags, "i_format", 0, "tiff", -1, 0);
   
   /*   TIFFPrintDirectory(tif, stdout, 0); good for debugging */