Commit Graph

66 Commits

Author SHA1 Message Date
Aleksandr Karpinskii
4a284a78c5 Remove weird comments 2024-09-11 20:40:46 +10:00
Yay295
204ec11f64 use local variable instead of casting every line 2024-07-19 08:46:25 -05:00
pre-commit-ci[bot]
2973b041c7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-07-16 12:58:04 +00:00
Lysandros Nikolaou
9c576d63c3
Fix refcounts after porting to GetItemRef & better error checking 2024-07-13 12:24:02 +02:00
Lysandros Nikolaou
f5313db9ce
Add necessary PyMem_Free and fix PyDict_GetItemRef call 2024-07-13 11:00:57 +02:00
Hugo van Kemenade
7c64ae0c73 encode: Replace PyDict_GetItem with PyDict_GetItemRef 2024-07-08 15:42:26 +03:00
Hugo van Kemenade
377bdc0db1 encode: Replace PyList_GetItem with PyList_GetItemRef 2024-07-08 15:42:26 +03:00
pre-commit-ci[bot]
617e7295a8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-25 12:51:24 +00:00
Benjamin Gilbert
4b422db243 Add keep_rgb option to prevent RGB -> YCbCr conversion during JPEG write
libjpeg automatically converts RGB to YCbCr by default.  Add a keep_rgb
option to disable libjpeg's automatic conversion of RGB images during
write.
2023-12-13 18:26:35 -06:00
Benjamin Gilbert
e572722479 Allow configuring JPEG restart marker interval on save
libjpeg allows specifying the marker interval either in MCU blocks or in
MCU rows.  Support both, via separate parameters, rather than requiring
callers to do the math.

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
2023-10-31 17:47:25 -05:00
Yay295
e7398c7888 update PyTypeObject slot names
tp_print was renamed to tp_vectorcall_offset with Python 3.8, and tp_compare was renamed to tp_as_async with Python 3.5.
tp_size has always been tp_basicsize; I don't know why that one was wrong.
2023-07-02 00:52:08 -05:00
Andrew Murray
b1b0353d17 Corrected passing TIFF_LONG to libtiff 2023-04-01 12:21:16 +11:00
Andrew Murray
2f66d2d6a1 Changed maximum comment length to 65531 2023-03-29 19:25:35 +11:00
Andrew Murray
1fd189164c Renamed "add_plt" to "plt" 2023-03-27 22:38:29 +11:00
Andrew Murray
7c3fd25433 Allow saving bytes as comments 2023-03-24 09:45:51 +11:00
Andrew Murray
04e8a9b3e7 Removed unnecessary code 2023-01-31 22:32:02 +11:00
Josh Ware
fcf5b7ef83 Fixed merge conflicts during recent pull 2023-01-19 11:33:15 +11:00
Andrew Murray
4518dc82ba Merge branch 'main' into signed 2022-12-29 09:37:35 +11:00
Andrew Murray
1d780081a6 Free comment when returning early 2022-12-06 20:22:12 +11:00
Sam Mason
eddc9bdcec
switch to #z for comment parameter
* means `comment=None` can be passed directly
* no need to conditionally run `str.encode()`
* clean up checking of whether a comment is passed
2022-12-05 17:46:54 +00:00
Andrew Murray
e50ae85ea4 Use jpeg_write_marker to write comment 2022-12-05 13:57:26 +11:00
Andrew Murray
6ddbe4cbf0 Added signed option when saving JPEG2000 images 2022-11-03 18:26:31 +11:00
scaramallion
07be0d26ba Re-add explicit default MCT value 2022-03-31 22:13:17 +03:00
scaramallion
bab4effbce Fix s390x build failure 2022-03-31 22:13:17 +03:00
scaramallion
de26f78eb1 Add 'mct' and 'use_jp2' options for J2K saving 2022-03-31 22:13:17 +03:00
Andrew Murray
747029bea9 Simplified code 2022-02-25 16:07:32 +11:00
Hood
7a93328834 Fix _get_pushes_fd and _get_pulls_fd method signatures
Getters are supposed to have signature "PyObject *(PyObject *self, void *closure)", but the closure argument is often not used.
In wasm it causes a trap if a function is declared with one argument and then called with two.
2021-11-15 08:49:55 -08:00
Andrew Murray
5cdcc2cf64 Added tags when saving YCbCr TIFF 2021-07-10 01:20:36 +10:00
Andrew Murray
f2ee5d6697 Use METH_VARARGS flags 2021-05-11 20:16:44 +10:00
Andrew Murray
8be655bec6 Merge branch 'master' into core_tags 2021-04-11 12:46:37 +10:00
Eric Soroos
441e6426ae Initialize buffer with 0, fixes valgrind undefined behavior issues 2021-04-09 13:41:23 +02:00
Andrew Murray
9d489f69ae Removed duplicate word in error message 2021-04-05 19:34:00 +10:00
Andrew Murray
56dfc4a956 Added 301 and 532 to core tags 2021-04-05 19:01:13 +10:00
Andrew Murray
46b7e86bab Format with ClangFormat 2021-01-03 14:17:51 +11:00
Andrew Murray
b7fb39fff8 Use ImagingError_MemoryError NULL return value 2020-12-20 13:00:16 +11:00
Andrew Murray
75542fea6d Replaced PyErr_NoMemory with ImagingError_MemoryError 2020-12-20 13:00:10 +11:00
Andrew Murray
7e4db0a80e Prefix other header includes 2020-09-22 13:33:05 +10:00
Axel Huebl
f79379ed7c Imaging.h: confusion with system
The file `libImaging/Imaging.h` gets installed flat on
Ubuntus into the public Python includes.

When building a newer version of Pillow from source and
hinting the Python includes "too early" in includes, e.g.
in package managers, this can confuse the two files and
pick up the external file over the internal one. With
different versions, this mismatch can lead to build errors,
e.g. undefined macros.

The most robust way to avoid this is to pre-fix the internal
include accordingly, so that the relative path to the including
file has to match as well.
2020-09-17 18:06:45 +10:00
Andrew Murray
799b25d9f1 Renamed zip header file 2020-08-31 22:44:51 +10:00
Peter Petrik
ef88be6548 fix build on macos and clang when zip.h is present on system from zlib library 2020-07-23 15:59:18 +02:00
Andrew Murray
d728cd5875 Allow libtiff to write COLORMAP tag 2020-06-20 22:38:38 +10:00
Andrew Murray
2d284aea12 Allow writing of UNDEFINED tags 2020-06-10 16:09:22 +10:00
Andrew Murray
859b27572b Removed forcing of BYTE to ASCII 2020-06-10 16:09:22 +10:00
Andrew Murray
7ecb5aaf7e BYTE tags of variable length are only single strings 2020-06-10 16:09:22 +10:00
Andrew Murray
3a75e843f4 Added braces 2020-05-11 07:46:12 +10:00
Andrew Murray
c1d9931adc Added braces 2020-05-10 19:56:36 +10:00
Andrew Murray
ae43af61da Replaced tabs with spaces 2020-05-01 22:08:57 +10:00
Hugo
dda6145fce Since Python 3.3 IOError and WindowsError have been merged into OSError 2020-04-10 12:57:29 +03:00
Hugo
af770a6c55 Drop support for EOL Python 2.7 2019-10-07 14:30:59 +03:00
Andrew Murray
2995fb67c1 Return after error 2019-07-13 13:50:13 +10:00