# HG changeset patch # User magedrifaat # Date 1656085500 -7200 # Node ID c581ec211b45d1bbaf285262931b86395c303243 # Parent edfedae9972a1a89819d200a9172c924c09927d6 Fixed bug for string tags. Multivalued and special case tags are still not working diff -r edfedae9972a -r c581ec211b45 libinterp/dldfcn/__tiff__.cc --- a/libinterp/dldfcn/__tiff__.cc Fri Jun 24 04:13:33 2022 +0200 +++ b/libinterp/dldfcn/__tiff__.cc Fri Jun 24 17:45:00 2022 +0200 @@ -25,7 +25,7 @@ break; case TIFF_ASCII: - ov_data(0) = octave_value((char *)data); + ov_data(0) = octave_value(*(char **)data); break; case TIFF_SHORT: @@ -35,7 +35,9 @@ } break; + // TODO(maged): why is the data type 64-bit for non-bigtiff images? case TIFF_LONG: + case TIFF_LONG8: for (uint32_t i = 0; i < count; i++) { ov_data(i) = octave_value(((uint32_t *)data)[i]); @@ -64,6 +66,7 @@ break; case TIFF_SLONG: + case TIFF_SLONG8: for (uint32_t i = 0; i < count; i++) { ov_data(i) = octave_value(((int32_t *)data)[i]); @@ -92,6 +95,7 @@ break; case TIFF_IFD: + case TIFF_IFD8: // TODO(maged): implement IFD datatype error("Unimplemented IFFD data type"); break; @@ -189,8 +193,11 @@ octave_value tag_data_ov; + // TIFFFieldReadCount returns VARIABLE for some scalar tags (e.g. Compression) + // But TIFFFieldPassCount seems consistent if (!TIFFFieldPassCount(fip)) { + // TODO(maged): test this function vs actual data type size int type_size = TIFFDataWidth(TIFFFieldDataType(fip)); void *data = _TIFFmalloc(type_size); // TODO(maged): This won't always work, e.g. string exepcts char **