Commit Graph

41 Commits

Author SHA1 Message Date
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
Oliver Tonnhofer
edeb8d69af
Merge branch 'master' into tiff-jpeg-quality 2019-07-01 11:00:06 +02:00
Oliver Tonnhofer
2af4026201 Improve encoding of TIFF tags (#3861)
* Improve encoding of TIFF tags

- Pass tagtype from v2 directory to libtiff encoder, instead of
autodetecting type.
- Use explicit types. E.g. uint32_t for TIFF_LONG to fix issues on
platforms with 64bit longs.
- Add support for multiple values (arrays). Requires type in v2
directory and values must be passed as a tuple.
- Add support for signed types (e.g. TIFFTypes.TIFF_SIGNED_SHORT).

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
2019-06-30 21:48:19 +03:00
Andrew Murray
c994b783ec
Merge branch 'master' into tiff-jpeg-quality 2019-06-30 14:03:09 +10:00
Oliver Tonnhofer
2b7d8be536 tiff: add support for JPEG quality
Uses JPEGQUALITY pseudo-tag from libtiff.

Also changes the way tags are passed to PyImaging_LibTiffEncoderNew from
dict to list to ensure that COMPRESSION tag is added before JPEGQUALITY.
This is required as the COMPRESSION tag registers the JPEGQUALITY
pseudo-tag.
2019-06-26 06:33:54 +10:00
Oliver Tonnhofer
61add9d6b0 Improve encoding of TIFF tags
- Pass tagtype from v2 directory to libtiff encoder, instead of
autodetecting type.
- Use explicit types. E.g. uint32_t for TIFF_LONG to fix issues on
platforms with 64bit longs.
- Add support for multiple values (arrays). Requires type in v2
directory and values must be passed as a tuple.
- Add support for signed types (e.g. TIFFTypes.TIFF_SIGNED_SHORT).
2019-06-26 06:33:19 +10:00
Elliott Sales de Andrade
560bc33731 Pass the correct types to PyArg_ParseTuple.
Py_ssize_t uses the 'n' specifier, not 'i'.
2019-05-31 05:55:13 -04:00
Andrew Murray
97c2848963 Fixed deprecation warnings 2019-03-26 13:50:57 +11:00
Andrew Murray
6ead422e91 Added custom string TIFF tags 2018-12-29 16:14:52 +11:00
Hugo
78bc4da131
Merge pull request #3350 from radarhere/custom_tags
Added custom int and float TIFF tags
2018-12-26 13:07:46 +02:00
Andrew Murray
d8e66c1882 Moved variable declaration and execution 2018-11-12 06:14:04 +11:00
Hugo
8d6347ab72 Changed array size to be arbitrary
Co-Authored-By: radarhere <radarhere@gmail.com>
2018-11-12 06:14:04 +11:00
Hugo
207ed04d87 Removed hardcoded array size
Co-Authored-By: radarhere <radarhere@gmail.com>
2018-11-12 06:14:04 +11:00
Andrew Murray
a3d45e9cef Added custom int and float TIFF tags 2018-11-12 06:14:04 +11:00
Lumir Balhar
78bf8ea041 Fix potential leaked storage issues (CWE-772) 2018-10-02 14:06:21 +02:00
Daniel Plakhotich
1d20056234 TGA: Add support for writing RLE data 2018-06-15 23:01:06 +03:00
wiredfool
0bb3f4fee9 source layout reorg 2017-12-28 14:49:47 +00:00