changeset 31103:76b21bed2920

Undocumented and unimplemented tags are explicilty mentioned and handled * __tiff__.cc: Comlpex unimplemented tags now give an error message and tags that are undocumented are explicitly mentioned.
author magedrifaat <magedrifaat@gmail.com>
date Sun, 03 Jul 2022 22:51:08 +0200
parents d6ecf0e8838b
children b5d59c115e52
files libinterp/dldfcn/__tiff__.cc
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__tiff__.cc	Sun Jul 03 21:51:37 2022 +0200
+++ b/libinterp/dldfcn/__tiff__.cc	Sun Jul 03 22:51:08 2022 +0200
@@ -323,16 +323,22 @@
           tag_data_ovl = interpret_data (types, count, TIFFFieldDataType (fip));
           break;
         }
-      // TODO(maged): Do I just return bytes? pass it to some parser lib?
+      // TODO(maged): These tags are more complex to implement
+      //  will be implemented and tested later.
       case TIFFTAG_XMLPACKET:
       case TIFFTAG_RICHTIFFIPTC:
       case TIFFTAG_PHOTOSHOP:
       case TIFFTAG_ICCPROFILE:
         {
-          uint16_t count;
-          void *data;
-          validate_tiff_get_field (TIFFGetField (tif, tag_id, &count, &data));
-          tag_data_ovl = interpret_data (data, count, TIFF_BYTE);
+          error ("Complex Tags not implemented");
+          break;
+        }
+      // Those two tags are not mentioned in the LibTIFF documentation
+      // but are handled correctly by the library
+      case TIFFTAG_ZIPQUALITY:
+      case TIFFTAG_SGILOGDATAFMT:
+        {
+          tag_data_ovl = get_scalar_field_data (tif, fip);
           break;
         }
       default: