# HG changeset patch # User magedrifaat # Date 1656283969 -7200 # Node ID 3cbd0d82167c4bd5e5ac4486575160ee61627ea5 # Parent 75ab26f147a57fd35c81ef56f14e234cb44dc874 getTag: Implemented all special tags, only unsupported geotiff tags not implemented diff -r 75ab26f147a5 -r 3cbd0d82167c libinterp/dldfcn/__tiff__.cc --- a/libinterp/dldfcn/__tiff__.cc Sun Jun 26 02:58:49 2022 +0200 +++ b/libinterp/dldfcn/__tiff__.cc Mon Jun 27 00:52:49 2022 +0200 @@ -203,6 +203,7 @@ octave_value_list tag_data_ovl; uint32_t tag_ID = TIFFFieldTag(fip); + // TODO(maged): find/create images to test the special tags switch(tag_ID) { case TIFFTAG_STRIPBYTECOUNTS: @@ -219,6 +220,141 @@ case TIFFTAG_REFERENCEBLACKWHITE: tag_data_ovl = get_array_field_data(tif, fip, 6); break; + // TODO(maged): colormap is not always 3 channels, but libtiff hardcodes it as 3? + case TIFFTAG_COLORMAP: + { + uint16_t bits_per_sample; + if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bits_per_sample)) + { + error("Failed to obtain the bit depth"); + } + + if (bits_per_sample > 24) + { + // TODO(maged): is this the right response here? + error("Too high bit depth for a palette image"); + } + + uint32_t count = 1<