Commit Graph

56 Commits

Author SHA1 Message Date
Jason Douglas
b3565d8ae3 Merge branch 'animated_webp' of https://github.com/monolithlabs/Pillow into animated_webp 2017-10-01 15:27:03 -07:00
Jason Douglas
28bec69e98 - flake8 formatting fixes
- webp => WebP doc and comment changes
2017-10-01 15:23:18 -07:00
hugovk
e75c386760 Avoid 'Symbol not found: _sprintf_s' on 'from PIL import _webp' 2017-09-30 19:47:20 +03:00
Jason Douglas
c9258d6cdb Move some more declarations to top of block 2017-09-29 13:59:05 -07:00
Jason Douglas
e32fb4f777 Move variable declaration to top of block 2017-09-29 13:21:26 -07:00
Jason Douglas
acc4334291 - Fix _webp reference when _webp is not available
- HandleMuxError function needs to be tied to WEBP_HAVEMUX, not WEBP_HAVEANIM
2017-09-27 22:13:13 -07:00
Jason Douglas
405d1a64d8 - Fix incorrect pixel width in WebP RGBX import call
- Add a test to cover RGBX import
2017-09-27 21:22:05 -07:00
Jason Douglas
b3e90a37e9 Fix implicit function declaration warning 2017-09-27 21:20:03 -07:00
Jason Douglas
247c2f59a1 Use PyErr_* functions instead of fprintf for error handling in _webp.c 2017-09-27 20:12:10 -07:00
Jason Douglas
c18d26b04b - Conditonally compile animation support, only if the mux.h and demux.h headers meet the ABI version requirements
- Add WEBPMUX support back to WebPDecode_wrapper (to support older versions of libwebp that have mux support, but not animation)
- Add HAVE_WEBPANIM flag, and use it appropriately
- Update documentation / tests
2017-09-27 19:04:24 -07:00
Jason Douglas
e534991409 - Styling changes to be C89-conformant
- Change WebPAnimEncoder/Decoder to use RGBX mode instead of RGB (since internally it is using RGBA always)
2017-09-27 17:10:25 -07:00
Jason Douglas
b46cf52883 Fix 'for' loop initial declaration error 2017-09-26 21:45:25 -07:00
Jason Douglas
cd12a48fe0 - Support non-alpha modes with WebPAnimDecoder
- Support writing metadata chunks with WebPAnimEncoder
- Add XMP metadata support to legacy WebPEncode wrapper
- Cleanup unused mux code in legacy WebPDecode wrapper
- Fix some bugs present when compiled without WebP Mux support
- Fix conversion from L/P/PA modes when saving WebP files
- Update existing tests, and add new ones for WebP animation and metadata support
2017-09-26 20:27:40 -07:00
Jason Douglas
482d803717 Add support for reading animated WebP files 2017-09-26 02:58:54 -07:00
Jason Douglas
6e4766155d Add support for writing animated webp files 2017-09-25 18:53:31 -07:00
wiredfool
ff2c440921 Additional replacements of s# with PY_ARG_BYTES_LENGTH 2017-08-22 04:04:35 -07:00
Alexander
441eded3eb fix compilation warning 2017-08-11 19:46:31 +03:00
Eric Soroos
d012f50975 Simplify feature checking, fix transparent webp detection, add webpmux detection 2017-06-13 04:20:21 -07:00
adw1n
9608e5050e Fixed mistakes in error handling when PyArg_ParseTuple raises an exception. 2017-05-12 00:21:39 +02:00
wiredfool
c3717da45a Undef PySlice_GetIndicesEx, see https://bugs.python.org/issue29943 2017-04-19 12:56:13 -07:00
Benoit Pierre
76bafe20a6 webp: better error checking when using Mux API 2015-02-23 11:10:37 +01:00
Benoit Pierre
fef9c7001d webp: fix memory leak when using Mux API 2015-02-23 11:10:37 +01:00
Benoit Pierre
4930b66aa9 webp: fix memory leak
The "S" format specifier for Py_BuildValue *increases* the object
reference count.
2015-02-23 11:10:37 +01:00
Benoit Pierre
3d5dd3b4fc webp: minor cleanup 2015-02-23 11:10:37 +01:00
homm
503da57b6e do not use loseless abi until it supported 2014-01-17 17:24:52 +04:00
Cezar Sa Espinola
2729401cc3 Fixed memory leak saving images as webp when webpmux is available 2013-11-29 14:33:57 -02:00
wiredfool
a18ef74886 pass bool flag as int, not object 2013-10-20 20:54:12 -07:00
Dan McDougall
0a91541df8 Add support for saving lossless WebP. Just pass 'lossless=True' to save(). 2013-10-20 15:44:22 -04:00
wiredfool
cbfae86f24 Rework of the removal of the Py_ssize_t patch. Explictly downcast the py_ssize_t to ints rather than rely on ints coming back from PyArg_ParseTuple 2013-10-04 11:29:01 -07:00
Christoph Gohlke
c9f7efa79d Restore compatibilty with ANSI C again 2013-10-03 19:30:07 -07:00
wiredfool
5ac92bbbf1 64 bit clean sizes to pass webp_metadata tests on PyPy 2.1.0 2013-10-02 12:04:16 -07:00
Alex Clark ☺
5e1e2fb203 Merge pull request #289 from cgohlke/patch-3
Restore compatibility with ISO C
2013-07-14 03:07:43 -07:00
Christoph Gohlke
61879e217d Restore compatibility with ISO C 2013-07-13 20:26:12 -07:00
Christoph Gohlke
ca404aed61 Use correct format character for C int type 2013-07-13 18:45:28 -07:00
Bernardo Heynemann
b4735f7829 Adding support for metadata in webp images.
Pillow now uses the webpmux library to envelop the webp images in RIFF. This allows for easy support of exif and icc_profile metadata.

Also included tests that verify compatibility with jpeg for exif and icc_profile metadata.

If the user does not have webp with webpmux enabled, pillow will fall back to the previous approach, meaning no exif or icc_profile metadata will be read or written to.
2013-07-04 18:04:07 -03:00
Alex Clark
bb1b3a532c Cleanup WS, courtesy of @Arfrever
find * -type f "-(" -name "*.bdf" -o -name "*.c" -o -name "*.h" -o -name "*.py" -o -name "*.rst" -o -name "*.txt" "-)" -exec sed -e "s/[[:space:]]*$//" -i {} \;
2013-06-30 18:42:19 -04:00
Christoph Gohlke
d2cb7a126b BUG: Fix webp encode errors on win-amd64 2013-06-29 14:05:48 -07:00
wiredfool
a7d778eba4 added free buffer if there's a problem decoding 2013-05-16 10:45:47 -07:00
wiredfool
89b6820530 checking raw image length, cleanup and DRY 2013-05-15 17:04:17 -07:00
wiredfool
11a0fb5f76 consolidated to WebPEncode_wrapper 2013-05-15 16:56:59 -07:00
wiredfool
a235a69d0c removed WebPGetFeatures_wrapper, as it's not used from python anymore 2013-05-15 16:39:01 -07:00
wiredfool
94239540db fixing deferring the rgba tests, whitespace 2013-05-13 22:21:52 -07:00
wiredfool
21e3fd2eb7 untabified whitespace 2013-05-13 21:47:35 -07:00
wiredfool
9ac38c1a3a using the Py_RETURN_NONE macro 2013-05-13 21:46:50 -07:00
wiredfool
a7488d287e py3k -- PyUnicode_FromString instead of PyString_fromString 2013-05-13 21:43:13 -07:00
wiredfool
014ca1497d versions, feature checking 2013-05-13 21:28:18 -07:00
wiredfool
0472b91d16 really working webp alpha decoding 2013-05-13 21:27:41 -07:00
wiredfool
b52c22316f inprogress, sorta working 2013-05-13 20:50:10 -07:00
wiredfool
4852aa5b65 working WebPGetFeatures 2013-05-13 11:30:19 -07:00
Euan Goddard
5a0308cc19 Partial work to add a wrapper for WebPGetFeatures to correctly support #204 2013-05-13 17:02:36 +01:00