diff libinterp/dldfcn/__tiff__.cc @ 31143:a68f2dadafee

Tiff.m: added all remaining tests for implemented features.
author magedrifaat <magedrifaat@gmail.com>
date Sun, 31 Jul 2022 00:13:04 +0200
parents 97e7ee3b27b7
children 8ba9f2326ee9
line wrap: on
line diff
--- a/libinterp/dldfcn/__tiff__.cc	Fri Jul 29 01:16:02 2022 +0200
+++ b/libinterp/dldfcn/__tiff__.cc	Sun Jul 31 00:13:04 2022 +0200
@@ -725,8 +725,10 @@
           if (! TIFFGetFieldDefaulted (tif, TIFFTAG_BITSPERSAMPLE,
                                        &bits_per_sample))
             error ("Failed to obtain the bit depth");
-                
-          if (bits_per_sample > 24)
+          
+          // According to the format specification, this field should
+          // be 8 or 16 only.
+          if (bits_per_sample > 16)
             error ("Too high bit depth for a palette image");
 
           uint32_t count = 1 << bits_per_sample;
@@ -1207,7 +1209,7 @@
     tiff_image_data image_data (tif);
 
     if (image_data.is_tiled)
-      error ("Can't rite strips to a tiled image");
+      error ("Can't write strips to a tiled image");
 
     uint32_t strip_no = args (1).uint32_scalar_value ();
     if (strip_no < 1 || strip_no > TIFFNumberOfStrips (tif))