From 7172a44caa33d5b5cbc45f0b8f9c3baeb2b6d694 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 12 Dec 2018 21:25:05 +1100 Subject: [PATCH] Added libjpegturbo to check_feature --- src/PIL/features.py | 3 ++- src/_imaging.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PIL/features.py b/src/PIL/features.py index 9926445ec..b8c9fdd8c 100644 --- a/src/PIL/features.py +++ b/src/PIL/features.py @@ -51,7 +51,8 @@ features = { "webp_anim": ("PIL._webp", 'HAVE_WEBPANIM'), "webp_mux": ("PIL._webp", 'HAVE_WEBPMUX'), "transp_webp": ("PIL._webp", "HAVE_TRANSPARENCY"), - "raqm": ("PIL._imagingft", "HAVE_RAQM") + "raqm": ("PIL._imagingft", "HAVE_RAQM"), + "libjpegturbo": ("PIL._imaging", "HAVE_LIBJPEGTURBO") } diff --git a/src/_imaging.c b/src/_imaging.c index 474444348..e547d9d31 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -3836,6 +3836,12 @@ setup_module(PyObject* m) { } #endif +#ifdef LIBJPEG_TURBO_VERSION + PyModule_AddObject(m, "HAVE_LIBJPEGTURBO", Py_True); +#else + PyModule_AddObject(m, "HAVE_LIBJPEGTURBO", Py_False); +#endif + #ifdef HAVE_LIBZ /* zip encoding strategies */ PyModule_AddIntConstant(m, "DEFAULT_STRATEGY", Z_DEFAULT_STRATEGY);