changeset 31200:4e8152ccc61a

libtinterp/corefcn/__tiff__.cc (set_field_data): fixed bug for ExtraSamples.
author magedrifaat <magedrifaat@gmail.com>
date Fri, 02 Sep 2022 03:41:05 +0200
parents 30b28458bb06
children e5e8cb049b4b
files libinterp/corefcn/__tiff__.cc
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__tiff__.cc	Fri Sep 02 03:30:45 2022 +0200
+++ b/libinterp/corefcn/__tiff__.cc	Fri Sep 02 03:41:05 2022 +0200
@@ -1605,9 +1605,8 @@
             error ("Failed to obtain the number of samples per pixel");
           
           uint16NDArray data_array = tag_ov.uint16_array_value ();
-          // FIXME: this only works for RGB images. Need to handle grayscale,
-          // palette, cmyk and ycbcr
-          if (data_array.numel () > samples_per_pixel - 3)
+          
+          if (data_array.numel () > samples_per_pixel)
             error ("Failed to set field, too many values");
           
           if (! TIFFSetField (tif, tag_id,