Skip to content

Allow libtiff_support_custom_tags to be missing#7020

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:no_libtiff
Mar 21, 2023
Merged

Allow libtiff_support_custom_tags to be missing#7020
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:no_libtiff

Conversation

@radarhere
Copy link
Member

Resolves #7019

Image.core.libtiff_support_custom_tags may be missing, if libtiff is unavailable.

Pillow/src/_imaging.c

Lines 4256 to 4272 in 2d5f451

#ifdef HAVE_LIBTIFF
{
extern const char *ImagingTiffVersion(void);
PyDict_SetItemString(
d, "libtiff_version", PyUnicode_FromString(ImagingTiffVersion()));
// Test for libtiff 4.0 or later, excluding libtiff 3.9.6 and 3.9.7
PyObject *support_custom_tags;
#if TIFFLIB_VERSION >= 20111221 && TIFFLIB_VERSION != 20120218 && \
TIFFLIB_VERSION != 20120922
support_custom_tags = Py_True;
#else
support_custom_tags = Py_False;
#endif
PyDict_SetItemString(d, "libtiff_support_custom_tags", support_custom_tags);
}
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: module 'PIL._imaging' has no attribute 'libtiff_support_custom_tags'

2 participants