From 56dfc4a95607a7c6cfcf908a680cc796cb21a281 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 5 Apr 2021 19:01:13 +1000 Subject: [PATCH 1/2] Added 301 and 532 to core tags --- src/PIL/TiffTags.py | 3 --- src/encode.c | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/PIL/TiffTags.py b/src/PIL/TiffTags.py index 9e9e117a4..088272162 100644 --- a/src/PIL/TiffTags.py +++ b/src/PIL/TiffTags.py @@ -485,9 +485,6 @@ LIBTIFF_CORE = { 65537, } -LIBTIFF_CORE.remove(301) # Array of short, crashes -LIBTIFF_CORE.remove(532) # Array of long, crashes - LIBTIFF_CORE.remove(255) # We don't have support for subfiletypes LIBTIFF_CORE.remove(322) # We don't have support for writing tiled images with libtiff LIBTIFF_CORE.remove(323) # Tiled images diff --git a/src/encode.c b/src/encode.c index f92ba62c2..d648c8aa5 100644 --- a/src/encode.c +++ b/src/encode.c @@ -644,10 +644,10 @@ PyImaging_LibTiffEncoderNew(PyObject *self, PyObject *args) { int key_int, status, is_core_tag, is_var_length, num_core_tags, i; TIFFDataType type = TIFF_NOTYPE; // This list also exists in TiffTags.py - const int core_tags[] = {256, 257, 258, 259, 262, 263, 266, 269, 274, - 277, 278, 280, 281, 340, 341, 282, 283, 284, - 286, 287, 296, 297, 320, 321, 338, 32995, 32998, - 32996, 339, 32997, 330, 531, 530, 65537}; + const int core_tags[] = {256, 257, 258, 259, 262, 263, 266, 269, 274, + 277, 278, 280, 281, 340, 341, 282, 283, 284, + 286, 287, 296, 297, 320, 321, 338, 32995, 32998, + 32996, 339, 32997, 330, 531, 530, 65537, 301, 532}; Py_ssize_t tags_size; PyObject *item; From 9d489f69ae5f5d285beb2bb251b6b0dc117bc983 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 5 Apr 2021 19:06:22 +1000 Subject: [PATCH 2/2] Removed duplicate word in error message --- src/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encode.c b/src/encode.c index d648c8aa5..52392cf33 100644 --- a/src/encode.c +++ b/src/encode.c @@ -790,7 +790,7 @@ PyImaging_LibTiffEncoderNew(PyObject *self, PyObject *args) { int stride = 256; if (len != 768) { PyErr_SetString( - PyExc_ValueError, "Requiring 768 items for for Colormap"); + PyExc_ValueError, "Requiring 768 items for Colormap"); return NULL; } UINT16 *av;