From 2eb5a954cb7b7ad61559da00743c4b0e2fce34d0 Mon Sep 17 00:00:00 2001 From: Sam Hasinoff Date: Sun, 8 Mar 2020 21:23:16 +0100 Subject: [PATCH] Make TIFFTAG_CFAPATTERN variable count The TIFFTAG_CFAPATTERN tag (33422) from TIFF/EP, recently introduced in libtiff 3363eda09d082e3e1dfffa6281f53085cac51ad3 / http://bugzilla.maptools.org/show_bug.cgi?id=2457 is described as having a fixed count of 4. But the TIFF/EP spec says this should support a variable count (= CFARepeatRows * CFARepeatCols): TIFF/EP, ISO 12234-2:2001 http://www.barrypearson.co.uk/top2009/downloads/TAG2000-22_DIS12234-2.pdf page 18 and 26 --- libtiff/tif_dirinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c index 99b0a3ea..62fbbbbd 100644 --- a/libtiff/tif_dirinfo.c +++ b/libtiff/tif_dirinfo.c @@ -145,7 +145,7 @@ tiffFields[] = { { TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen", NULL }, { TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera", NULL }, { TIFFTAG_CFAREPEATPATTERNDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CFARepeatPatternDim", NULL }, - { TIFFTAG_CFAPATTERN, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CFAPattern" , NULL}, + { TIFFTAG_CFAPATTERN, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CFAPattern" , NULL}, { TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Copyright", NULL }, /* end Pixar tags */ { TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "RichTIFFIPTC", NULL },