Skip to content

Commit

Permalink
Merge pull request #3493 from radarhere/libjpegturbo
Browse files Browse the repository at this point in the history
Added libjpeg_turbo to check_feature
  • Loading branch information
hugovk committed Dec 13, 2018
2 parents 27c86ba + 233915b commit 2659eda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PIL/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_supported_codecs():
"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"),
"libjpeg_turbo": ("PIL._imaging", "HAVE_LIBJPEGTURBO"),
}


Expand Down
10 changes: 10 additions & 0 deletions src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@

#include "Python.h"

#ifdef HAVE_LIBJPEG
#include "jconfig.h"
#endif

#ifdef HAVE_LIBZ
#include "zlib.h"
#endif
Expand Down Expand Up @@ -3836,6 +3840,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);
Expand Down

0 comments on commit 2659eda

Please sign in to comment.