Commit Graph

3023 Commits

Author SHA1 Message Date
Jon Dufresne
1a3ebafdd2 Replace SimplePatcher with builtin unittest.mock module
The class more or less duplicates the features of the mock module. Can
avoid the duplication by using the stdlib.
2020-02-17 10:06:19 -08:00
Jon Dufresne
6121daa72d Remove redundant str() call
The %s placeholder already coerces arguments to a string.
2020-02-17 09:18:49 -08:00
Hugo
946a038b13 Replace unittest with pytest 2020-02-17 10:42:33 +02:00
Hugo
eb2d6560a4 Replace unittest with pytest 2020-02-17 00:55:52 +02:00
orlnub123
64c08f4dba Fix test 2020-02-16 21:26:40 +11:00
orlnub123
6d3c7d6941 Add test against upscaling 2020-02-16 21:26:17 +11:00
orlnub123
e9ef1d236d Fix size calculation of Image.thumbnail() 2020-02-16 21:25:51 +11:00
Andrew Murray
8e81e0dd0e Restored test 2020-02-16 13:44:34 +11:00
Hugo
9087599e60 Merge remote-tracking branch 'upstream/master' into pytest 2020-02-15 16:56:21 +02:00
Hugo van Kemenade
852d9156bc
Remove commas
Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2020-02-15 16:21:37 +02:00
Hugo van Kemenade
0e993c4740
Merge pull request #4334 from radarhere/outline_width
Allow explicit zero width to hide outline
2020-02-15 14:30:12 +02:00
Andrew Murray
f958e2f8ed Return strings or bytes from ContainerIO according to the file object mode 2020-02-15 22:13:10 +11:00
Jon Dufresne
e817ed0d3e Correct str/bytes mixup in ContainerIO
Image data is expected to be read in bytes mode, not text mode so
ContainerIO should return bytes in all methods. The passed in file
handler is expected to be opened in bytes mode (as TarIO already does).
2020-02-15 22:13:10 +11:00
Andrew Murray
919abe2555 Updated test 2020-02-15 21:17:26 +11:00
Hugo van Kemenade
c57e4b3a85
Merge pull request #4333 from radarhere/polygon
Only draw each polygon pixel once
2020-02-15 11:57:14 +02:00
ben
a4721d374f Fixes djpeg load test
* Test fails with `libjpeg-turbo` and `libjpeg-progs` on Ubuntu 16.04
* Epsilon reported is 4.18...
2020-02-15 13:59:53 +11:00
Jon Dufresne
e544fd5fb7 Simplify command discovery with stdlib shutil.which()
Use the builtin shutil.which() instead of reimplementing.

For the single use that used the output of the command, use
subprocess.run().
2020-02-14 14:55:46 -08:00
Hugo
affade7595 Replace unittest with pytest 2020-02-13 12:15:05 +02:00
Hugo van Kemenade
098406c304
Merge pull request #4390 from jdufresne/resource-warning
Fix ResourceWarning emitted during tests
2020-02-12 17:10:51 +02:00
Hugo
38bf862185 Replace PillowTestCase.assert_warning with pytest.warns 2020-02-03 11:11:32 +02:00
Hugo
a4bf9fa036 Convert most PillowTestCase methods to pytest 2020-02-02 12:26:01 +02:00
Hugo van Kemenade
f6e067b3b4
Merge pull request #4391 from radarhere/pytest
Convert various tests to pytest style
2020-01-28 18:22:11 +02:00
Andrew Murray
eeb2588fe2
Corrected skip condition
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-01-28 19:59:41 +11:00
Alexander Karpinsky
5965437402
Merge pull request #4370 from uploadcare/jpeg-multiple-app13
Handle multiple and malformed JPEG APP13 markers
2020-01-27 15:46:36 +03:00
Andrew Murray
7fd9663198 Convert various tests to pytest style 2020-01-27 22:46:52 +11:00
Jon Dufresne
2b84221edf Fix ResourceWarning emitted during tests
Appeared in the form:

    ResourceWarning: unclosed file <_io.BufferedReader name='Tests/images/invalid-exif-without-x-resolution.jpg'>

Enable all warnings to always display during tests to help catch these
warnings earlier.
2020-01-26 16:00:46 -08:00
Hugo van Kemenade
22a6738a81
Merge pull request #4369 from jdufresne/pytest
Convert some tests to pytest style
2020-01-26 20:18:37 +02:00
Jon Dufresne
63729766c4 Remove unnecessary coerce to float
In Python 3, the division operator is floating point division. No longer
need to coerce integers to floating point numbers before division.
2020-01-26 06:33:18 -08:00
Alexander
73171f5046 add test image 2020-01-20 17:25:40 +03:00
Jon Dufresne
2c50723f14 Convert some tests to pytest style
To better follow conventional pytest style, this removes the outer
wrapper class in favor of a function for some tests. These tests were
picked as they are relatively simple and presented no barriers to a
quick port. The assert* methods are replaced with assert statements.
When necessary, a fixture is used to create a temporary directory.

This commit does not convert the entire test suite to this style as some
test classes use methods or other advanced features that are difficult
to automatically convert. The goal is to address these issues in
followup commits.

Refs #4193
2020-01-18 12:12:10 -08:00
Andrew Murray
760bc7dd38 Test seek errors 2020-01-14 21:38:17 +11:00
Andrew Murray
f3f9190de7 Roundtrip test hotspot 2020-01-14 21:38:17 +11:00
Andrew Murray
dbd3c7c9b9 Test saving with incorrect mode 2020-01-14 21:38:17 +11:00
Andrew Murray
9bed79e426 Test grab bbox 2020-01-14 21:38:17 +11:00
Andrew Murray
5439091355 Simplified code 2020-01-14 20:20:30 +11:00
Andrew Murray
a5f036abf4 Moved messages into assert method calls 2020-01-14 20:20:19 +11:00
Andrew Murray
d324560891 Removed print 2020-01-14 19:44:10 +11:00
Andrew Murray
a4f06b93f9 Removed unused function 2020-01-14 19:40:21 +11:00
Hugo
5e9336af4c Use sys.byteorder == "big" 2020-01-08 15:43:28 +02:00
Hugo
f96763826c Test on new Travis CPUs https://blog.travis-ci.com/2019-11-12-multi-cpu-architecture-ibm-power-ibm-z 2020-01-08 15:43:27 +02:00
Andrew Murray
56f30ef792 Allow explicit zero width to hide outline 2020-01-08 21:55:15 +11:00
Andrew Murray
8e8f63d4a5 Only draw each polygon pixel once 2020-01-05 17:43:51 +11:00
Andrew Murray
b9c68540dc Overflow checks for realloc for tiff decoding 2020-01-02 15:24:46 +11:00
Andrew Murray
be44f0d992 Catch SGI buffer overruns 2020-01-02 15:24:36 +11:00
Andrew Murray
8f0c8f7311 Catch PCX P mode buffer overrun 2020-01-02 15:24:16 +11:00
Andrew Murray
c40bc25847 Catch FLI buffer overrun 2020-01-02 15:23:36 +11:00
Andrew Murray
138bd714f5 Raise an error for an invalid number of bands in FPX image 2020-01-02 15:20:24 +11:00
Andrew Murray
4203845a24
Merge pull request #4320 from uploadcare/rgb2l-rounding-error
Fix rounding error on RGB to L conversion
2020-01-01 20:09:34 +11:00
Andrew Murray
e8bb2dd93e Allow string comment when saving GIF 2020-01-01 13:29:39 +11:00
nulano
6bf7f6045d fix deprecation warnings in test_file_wmf 2020-01-01 01:55:06 +01:00
Andrew Murray
8924054dd9 Changed _limit_signed_rational 2019-12-31 19:12:33 +11:00
Andrew Murray
69fc041399 Test out of bounds signed rational 2019-12-31 19:11:03 +11:00
Alexander
fa1deca144 Fix wrong tests 2019-12-31 04:12:50 +03:00
Andrew Murray
74d53bcd15 Lint fixes 2019-12-31 11:58:39 +11:00
Andrew Murray
6d3fb7b083
Merge branch 'master' into exif-writing-fixes 2019-12-31 11:38:33 +11:00
Andrew Murray
f72e866b5e
Merge pull request #4305 from radarhere/remove_distutils
Replaced distutils with C version check
2019-12-31 11:33:39 +11:00
Andrew Murray
f77c409742 Renamed variable 2019-12-31 09:04:25 +11:00
Alexander
c74c20eb9f Merge branch 'master' into reduce-in-resize
# Conflicts:
#	docs/releasenotes/7.0.0.rst
2019-12-30 03:24:38 +03:00
Andrew Murray
2a0653ee81
Merge pull request #4311 from radarhere/wmf
Allow loading of WMF images at a given DPI
2019-12-30 10:24:44 +11:00
nulano
cc5c0d2c04 don't skip test fixed in pypy 7.3.0 2019-12-29 22:52:50 +01:00
Andrew Murray
61d0784933 Allow loading of WMF images at a given DPI 2019-12-28 11:25:39 +11:00
Andrew Murray
34d04d3e82 Replaced distutils with C version check 2019-12-28 09:57:49 +11:00
Alexander
222c2f6978 Merge branch 'master' into reduce-in-resize 2019-12-27 15:13:19 +03:00
Alexander Karpinsky
5f69035865
Merge pull request #4251 from uploadcare/reduce
Reduce operation
2019-12-27 15:11:47 +03:00
Alexander
fc0248869c wording 2019-12-27 14:27:37 +03:00
Hugo
86be41a167 Concatenate string literals on same line 2019-12-26 17:08:36 +02:00
Andrew Murray
fedb0407b4 Raise ValueError for io.StringIO in Image.open 2019-12-26 18:53:06 +11:00
Alexander
d719aafecb Merge branch 'reduce' into reduce-in-resize
# Conflicts:
#	docs/releasenotes/7.0.0.rst
2019-12-25 15:45:17 +03:00
Alexander
dda5558129 Merge branch 'master' into reduce 2019-12-25 15:42:47 +03:00
Alexander Karpinsky
b5d06baa5f
Merge pull request #4231 from uploadcare/box-in-thumbnail
Fix thumbnail geometry when DCT scaling is used
2019-12-25 15:41:40 +03:00
Andrew Murray
ee30fe1b39
Merge pull request #4147 from beipang2/issue_4146
Use default DPI when exif provides invalid x_resolution
2019-12-25 20:26:27 +11:00
Andrew Murray
666b726626 Simplified conditions 2019-12-25 15:32:38 +11:00
Andrew Murray
9a72ad4fa9 Removed condition already present from inheritance 2019-12-25 15:32:26 +11:00
Andrew Murray
c35fb6fb67
Merge branch 'master' into box-in-thumbnail 2019-12-24 18:18:34 +11:00
Andrew Murray
4580b156b7 Raise an error if BMP file size is too large when saving 2019-12-21 08:37:40 +11:00
Alexander
fc28182040 fix formatting 2019-12-20 20:42:00 +03:00
Alexander
8181aed77f Merge branch 'reduce' into reduce-in-resize
# Conflicts:
#	docs/releasenotes/7.0.0.rst
#	src/PIL/Image.py
2019-12-20 20:27:11 +03:00
Alexander
d41f2713b6 Merge branch 'master' into reduce 2019-12-20 20:22:36 +03:00
Alexander
a9d7a2be77 TestReducingGapResize 2019-12-20 20:20:28 +03:00
Alexander
b48996c213 rename max_reduce to reducing_gap 2019-12-20 14:59:18 +03:00
Alexander
b112e55070 Merge branch 'master' into box-in-thumbnail
# Conflicts:
#	docs/releasenotes/7.0.0.rst
2019-12-19 16:36:37 +03:00
Alexander Karpinsky
6d75a673b6
Merge pull request #4255 from uploadcare/default-resample-filter
Change default resize resampling filter from NEAREST to BICUBIC
2019-12-19 16:33:34 +03:00
Alexander Karpinsky
c82d2629d7
Merge pull request #4278 from uploadcare/fox-filter-black-lines
Define box filter equal 1.0 on (-0.5, 0.5] range instead of [-0.5, 0.5)
2019-12-19 03:26:17 +03:00
Alexander
5b53b0489b Define box filter equal 1.0 on (-0.5, 0.5] range instead of [-0.5, 0.5) 2019-12-19 03:01:02 +03:00
Alexander
4da9858709 change default resampling filter for ImageOps.pad(), ImageOps.scale() and ImageOps.fit() 2019-12-17 18:15:02 +03:00
Alexander
fa9e85cd1f max_reduce arguments in resize and thumbnail 2019-12-17 03:01:51 +03:00
Alexander
2db5406626 Merge branch 'box-in-thumbnail' into reduce-in-resize-2 2019-12-17 02:27:44 +03:00
Alexander
ea9c6e9fe1 Merge branch 'master' into reduce 2019-12-17 02:26:05 +03:00
Alexander
b35cbef234 modify the test image 2019-12-17 02:25:40 +03:00
Alexander
a027897f74 Merge branch 'master' into box-in-thumbnail
# Conflicts:
#	Tests/test_image_thumbnail.py
2019-12-17 00:42:29 +03:00
Andrew Murray
c7bef264bc Allow thumbnail to accept non-integer size arguments 2019-12-17 06:05:36 +11:00
Alexander
791d1a2846 Better thumbnail aspect ratio preservation 2019-12-07 20:07:27 +03:00
Alexander
ac92836e81 Change default resize resampling filter 2019-12-07 18:08:19 +03:00
Alexander
5283538fe4 unused import 2019-12-05 22:20:01 +03:00
Alexander
e54b9b3720 turn on ImagingReduce5x5 special case 2019-12-05 22:13:25 +03:00
Alexander
b655e81d39 not square test image 2019-12-05 14:30:17 +03:00
Alexander
5283141417 Merge branch 'master' into reduce 2019-12-05 14:23:28 +03:00
Alexander
5838d77c0e args test 2019-12-05 03:24:38 +03:00
Alexander
778b5f9fed add box parameter 2019-12-04 23:13:20 +03:00
Alexander
cc30b1e55a Add La mode packing and unpacking 2019-12-04 22:58:09 +03:00
Alexander
a4a6a9e83a Add La mode packing and unpacking 2019-12-04 22:47:15 +03:00
Andrew Murray
4551d3aeb3
Merge pull request #4173 from hugovk/cover-tests
Include tests in coverage reports
2019-12-03 06:41:54 +11:00
Hugo
ebed90c228 Remove redundant files 2019-12-02 15:26:51 +02:00
Alexander
d92c58fa7f I mode support 2019-12-01 22:52:43 +03:00
Alexander
a576b14056 F mode support 2019-12-01 22:28:16 +03:00
Alexander Karpinsky
d970a39840 Special cases:
ImagingReduce1x2, ImagingReduce1x3, ImagingReduce2x1, ImagingReduce3x1
2019-12-01 21:41:15 +03:00
Alexander
1d1f3be27a unsupported modes 2019-12-01 20:34:05 +03:00
Alexander
008c1c88e2 L mode support 2019-12-01 20:33:48 +03:00
Alexander
a241f1ed8e complete tests for supported modes 2019-12-01 19:13:34 +03:00
Andrew Murray
2d7cfc4bbc
Merge pull request #4239 from radarhere/photoshop
Handle broken Photoshop data
2019-12-01 07:33:26 +11:00
Andrew Murray
08cad40002
Merge pull request #4181 from pwohlhart/patch-1
Better error messaging in PIL.Image.fromarray
2019-11-30 21:12:05 +11:00
Hugo van Kemenade
a776255a90
Merge pull request #4240 from radarhere/mpo
Raise a specific exception if no data is found for an MPO frame
2019-11-30 11:25:46 +02:00
Andrew Murray
47b2ae9a63 Raise a specific exception if no data is found for an MPO frame 2019-11-30 11:05:36 +11:00
Andrew Murray
e51be50549 Handle broken Photoshop data 2019-11-30 10:08:32 +11:00
Alexander
8b6ad4a471 tests for supported modes 2019-11-26 03:39:57 +03:00
Andrew Murray
c0048ad7de Use context managers 2019-11-26 07:03:23 +11:00
Alexander
c23f29481c try to deal with different libjpeg version 2019-11-24 15:34:12 +03:00
Alexander
e234445682 linter fixes 2019-11-24 15:32:45 +03:00
Hugo van Kemenade
37be3b0dda
Merge pull request #4145 from nulano/ucs4-pypy
Fix Unicode support for PyPy
2019-11-24 13:51:27 +02:00
Alexander
fd21de7dc4 Merge branch 'refs/heads/master' into box-in-thumbnail
# Conflicts:
#	Tests/test_image_thumbnail.py
2019-11-24 05:27:13 +03:00
Alexander
375556ffb5 use a box from draft in thumbnail 2019-11-24 05:24:00 +03:00
Alexander
4126f6cdf7 return chosen image mode and the box of the image 2019-11-24 04:55:49 +03:00
Jon Dufresne
33dabf986f Import unittest from stdlib rather than helper.py
The unittest in helper.py has not offered an interesting abstraction
since dbe9f85c7d so import from the more
typical stdlib location.
2019-11-20 18:42:52 -08:00
nulano
837d8ae984 fix support for extended unicode characters in PyPy 2019-11-20 17:02:44 +00:00
Hugo
106fc4085f Remove redundant files 2019-11-20 17:28:37 +02:00
Hugo
a1c6b5edf7 Cover tests https://nedbatchelder.com/blog/201908/dont_omit_tests_from_coverage.html 2019-11-20 17:28:12 +02:00
Hugo van Kemenade
a949d7882e
Merge branch 'master' into rm-2.7 2019-11-20 10:26:55 +02:00
Andrew Murray
40f891dfd7 Added UnidentifiedImageError 2019-11-19 21:20:02 +11:00
Hugo
e5486b40f8 Merge remote-tracking branch 'upstream/master' into rm-2.7 2019-11-18 13:56:42 +02:00
nulano
197fb91574 upload image errors to GitHub Actions 2019-11-17 21:49:58 +11:00
Hugo
12a725988e Merge remote-tracking branch 'upstream/master' into rm-2.7 2019-11-16 17:10:10 +02:00
Hugo van Kemenade
b64d96d414
Merge pull request #4116 from radarhere/memory
Fixed freeing unallocated pointer when resizing with height too large
2019-11-13 20:29:09 +02:00
Hugo van Kemenade
54e57768ab
Merge pull request #4128 from radarhere/info
Copy info in Image.transform
2019-11-13 20:27:51 +02:00
Hugo van Kemenade
ce18064b20
Merge pull request #4171 from radarhere/gamma
Corrected DdsImagePlugin setting info gamma
2019-11-13 20:26:03 +02:00
Andrew Murray
d79f2bb7dc Corrected context manager test 2019-11-06 20:12:19 +11:00
Hugo van Kemenade
3663af1967
Merge pull request #4189 from cgohlke/patch-1
Report details about Pillow when running tests
2019-11-05 13:01:02 +02:00
Hugo van Kemenade
5006401d0b
Merge branch 'master' into rm-2.7 2019-11-03 22:48:26 +02:00
Christoph Gohlke
5d10f8dff2
Use features.pilinfo to report details about Pillow 2019-11-02 15:12:52 -07:00
Hugo van Kemenade
6060ed3d14
Merge pull request #4091 from nulano/libimagequant-features
Add libimagequant to features.py
2019-11-02 21:31:09 +02:00
Andrew Murray
b1ee44a74b Ignore UserWarnings 2019-11-02 18:10:55 +11:00
Christoph Gohlke
579b6cac60
Report details about Pillow when running tests 2019-11-01 23:06:51 -07:00
Hugo
b4f93cf140 Upgrade Python syntax with pyupgrade --py3-plus 2019-11-01 13:54:19 +02:00
Hugo
cc63f66575 Merge remote-tracking branch 'upstream/master' into rm-2.7 2019-11-01 13:22:56 +02:00
Hugo van Kemenade
2cf510e596
Improve handling of file resources (#3577)
Improve handling of file resources
2019-11-01 12:07:53 +02:00
Andrew Murray
b65fcb280a Copy info in transform 2019-10-30 22:14:01 +11:00
Andrew Murray
d716278d20 Corrected DdsImagePlugin setting info gamma 2019-10-30 22:13:06 +11:00
Andrew Murray
511aed922a Fixed freeing unallocated pointer when resizing with height too large 2019-10-30 22:09:28 +11:00
Andrew Murray
9b20276c45 Allow for arr KeyError 2019-10-30 07:23:08 +11:00
Bei Pang
f53b86b673 Removed TypeError exception check in JpegImagePlugin; Updated comments in test 2019-10-28 09:48:37 -07:00
Bei Pang
bcc766e02d Use default DPI when exif provides invalid x_resolution 2019-10-27 07:50:30 +11:00
Hugo van Kemenade
40133cfc74
Merge branch 'master' into rm-2.7 2019-10-26 09:07:44 +03:00
Jon Dufresne
cae17eb927 Use more Pythonic super() instead of referencing parent class
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/
2019-10-22 06:54:58 -07:00
Hugo van Kemenade
1a9be9ccbd
Simpilify PillowTestCase.delete_tempfile for pytest (#4139)
Simpilify PillowTestCase.delete_tempfile for pytest
2019-10-22 14:14:20 +03:00
Hugo van Kemenade
28ff798889
Merge branch 'master' into rm-2.7 2019-10-15 12:11:43 +03:00
Jon Dufresne
9981568982 Simpilify PillowTestCase.delete_tempfile for pytest
As the test suite always runs with pytest now, self.currentResult is
always None. Using this, can remove unused code.
2019-10-12 11:13:14 -07:00
Jon Dufresne
4cd4adddc3 Improve handling of file resources
Follow Python's file object semantics. User code is responsible for
closing resources (usually through a context manager) in a deterministic
way.

To achieve this, remove __del__ functions. These functions used to
closed open file handlers in an attempt to silence Python
ResourceWarnings. However, using __del__ has the following drawbacks:

- __del__ isn't called until the object's reference count reaches 0.
  Therefore, resource handlers remain open or in use longer than
  necessary.

- The __del__ method isn't guaranteed to execute on system exit. See the
  Python documentation:

  https://docs.python.org/3/reference/datamodel.html#object.__del__

  > It is not guaranteed that __del__() methods are called for objects
  > that still exist when the interpreter exits.

- Exceptions that occur inside __del__ are ignored instead of raised.
  This has the potential of hiding bugs. This is also in the Python
  documentation:

  > Warning: Due to the precarious circumstances under which __del__()
  > methods are invoked, exceptions that occur during their execution
  > are ignored, and a warning is printed to sys.stderr instead.

Instead, always close resource handlers when they are no longer in use.
This will close the file handler at a specified point in the user's code
and not wait until the interpreter chooses to. It is always guaranteed
to run. And, if an exception occurs while closing the file handler, the
bug will not be ignored.

Now, when code receives a ResourceWarning, it will highlight an area
that is mishandling resources. It should not simply be silenced, but
fixed by closing resources with a context manager.

All warnings that were emitted during tests have been cleaned up. To
enable warnings, I passed the `-Wa` CLI option to Python. This exposed
some mishandling of resources in ImageFile.__init__() and
SpiderImagePlugin.loadImageSeries(), they too were fixed.
2019-10-12 08:27:17 -07:00
Jon Dufresne
0affbacd5e Remove unused arguments from PillowTestCase.skipKnwonBadTest() 2019-10-12 08:17:20 -07:00
nulano
accbe58b5e add Python version to selftest, rename brief parameter 2019-10-12 15:40:12 +01:00
Andrew Murray
4140cd807b
Merge branch 'master' into rm-2.7 2019-10-12 18:03:58 +11:00
Hugo
3e24c5fea4 Replace isStringType(t) with isinstance(t, str)
Co-Authored-By: Jon Dufresne <jon.dufresne@gmail.com>
2019-10-08 17:26:52 +03:00
Hugo
3a34081db5 Simplify temporary directory cleanup
Co-Authored-By: Jon Dufresne <jon.dufresne@gmail.com>
2019-10-08 17:25:55 +03:00
Hugo
84e53e3757 Simplify using subprocess.DEVNULL
Co-Authored-By: Jon Dufresne <jon.dufresne@gmail.com>
2019-10-08 17:25:42 +03:00
nulano
a0a5601689
Merge branch 'master' into gha-win 2019-10-08 12:56:43 +01:00
Andrew Murray
6cd99fc3cf
Merge branch 'master' into rm-2.7 2019-10-08 18:57:27 +11:00
Jon Dufresne
64032061c0 Move several imports to the top-level of the file
This better follows PEP 8 style guide:

https://www.python.org/dev/peps/pep-0008/#imports

> Imports are always put at the top of the file, just after any module
> comments and docstrings, and before module globals and constants.

This also avoids duplicate import code within the same file.
2019-10-07 06:28:36 -07:00
Hugo
4382413bb4 Remove redundant bytearray 2019-10-07 16:23:43 +03:00
Hugo
865b17d5cf Remove Python 2-compatibility code 2019-10-07 16:23:22 +03:00
Hugo
74d2767c57 Remove duplicate line 2019-10-07 14:30:59 +03:00
Hugo
538d9e2e5d Upgrade Python syntax with pyupgrade --py3-plus 2019-10-07 14:30:59 +03:00
Hugo
af770a6c55 Drop support for EOL Python 2.7 2019-10-07 14:30:59 +03:00
Jon Dufresne
922f55c265 Use bytes literals instead of bytes(str)
Bytes literals are available on all supported Python versions. Rather
than convert strings literals to bytes at runtime, simply use a bytes
literal.
2019-10-06 19:26:55 -07:00
Andrew Murray
e8cf9a6bc1
Merge pull request #4108 from hugovk/rm-deprecated-qt
Drop support for EOL PyQt4 and PySide
2019-10-07 12:35:56 +11:00
Jon Dufresne
c50a309a10 Remove duplicate cleanup in test_decompression_bomb.py
The same cleanup is done in the teardDown() method. There is no need to
do it a 2nd time.
2019-10-06 10:24:48 -07:00
Andrew Murray
732eb7223f
Merge branch 'master' into rm-deprecated-qt 2019-10-06 13:35:38 +11:00
Andrew Murray
d6ae0a99a7 Removed deprecated setting of TIFF image sizes 2019-10-03 22:12:28 +10:00
Andrew Murray
e487ed7fef Removed deprecation test 2019-10-02 22:01:31 +10:00
Hugo
f0a87e25a4 Drop support for EOL PyQt4 and PySide 2019-09-30 17:58:31 +03:00
Andrew Murray
cc16025e23
Merge pull request #4104 from radarhere/overrun
Catch buffer overruns
2019-09-30 23:33:28 +10:00
Andrew Murray
fb8470187a
Merge pull request #4034 from cgohlke/patch-1
Initialize rows_per_strip when RowsPerStrip tag is missing
2019-09-30 22:32:34 +10:00
Andrew Murray
b9693a51c9
Merge pull request #4103 from radarhere/dimension
Raise error if TIFF dimension is a string
2019-09-30 21:26:53 +10:00
Andrew Murray
f228d0ccbf
Merge pull request #4102 from radarhere/decompression
Added decompression bomb checks
2019-09-30 20:31:05 +10:00
Andrew Murray
9a977b975c Raise error if dimension is a string 2019-09-30 18:48:10 +10:00
Andrew Murray
ab52630d06 Catch buffer overruns 2019-09-30 18:45:43 +10:00
Andrew Murray
eed2bfc5b4 Added decompression bomb checks 2019-09-30 18:45:13 +10:00
Andrew Murray
87c43b66a5 Corrected negative seeks 2019-09-30 18:31:18 +10:00
Andrew Murray
4de10089f0 Moved libtiff test into libtiff test file 2019-09-29 21:06:11 +10:00
Hugo van Kemenade
d3ae7a1c46
Merge pull request #4088 from radarhere/fit
Do not calculate the crop width in Image.fit if it is already known
2019-09-29 12:57:29 +03:00
Andrew Murray
1809f46e0b Do not calculate the crop width if it is already known 2019-09-29 14:26:32 +10:00
nulano
17d9938ece spider labrec ceil 2019-09-27 22:10:49 +02:00
Hugo van Kemenade
310d2c9005
Add option to capture all monitors on Windows (#3950)
Add option to capture all monitors on Windows
2019-09-27 08:47:55 +03:00
nulano
cf1f8b0498 Tests.helper cleanup 2019-09-25 11:58:02 +02:00
nulano
113a72633a test-windows.yml clean names 2019-09-25 11:28:52 +02:00
nulano
4d35cb9d0a test-windows.yml pypy3, use actions/setup-python 2019-09-25 09:17:38 +02:00
Andrew Murray
7d502dd410 Cleanup by resetting locale 2019-09-23 20:26:34 +10:00
Andrew Murray
508a2b48f0 Test show method on CIs 2019-09-21 22:28:05 +10:00
Hugo van Kemenade
f5aed1a254
Merge branch 'master' into patch-1 2019-09-20 22:59:29 +03:00
Hugo van Kemenade
736b8436e7
Use TIFF orientation (#4063)
Use TIFF orientation
2019-09-20 22:57:58 +03:00
Hugo van Kemenade
8e3c4e3658
Merge pull request #3965 from radarhere/truncated
Raise the same error if a truncated image is loaded a second time
2019-09-20 22:53:52 +03:00
nulano
6a2d8f8da0 rename parameter, add note to docs 2019-09-20 17:35:08 +02:00
Andrew Murray
19ab3c36e6 Added test 2019-09-18 22:07:17 +10:00
Andrew Murray
1b70a4c6b5 Use TIFF orientation 2019-09-13 22:36:26 +10:00
Andrew Murray
b913fa6a53 Increased tolerance for stroke test comparison 2019-09-11 19:57:45 +10:00
Hugo van Kemenade
e5f6b86413
Merge pull request #4031 from radarhere/exif
Lazily use ImageFileDirectory_v1 values from Exif
2019-09-09 20:16:24 +03:00
Andrew Murray
5a668779e9 Added tests 2019-09-08 21:27:55 +10:00
Andrew Murray
14859ce506
Merge pull request #4004 from radarhere/hsv
Improved HSV conversion
2019-09-07 00:50:34 +10:00
Andrew Murray
da39d40342
Merge pull request #3978 from radarhere/stroke
Added text stroking
2019-09-06 19:14:49 +10:00
Hugo van Kemenade
cb1ebc024b
Merge pull request #4017 from radarhere/floodfill
Do not allow floodfill to extend into negative coordinates
2019-09-05 23:00:33 +03:00
Hugo van Kemenade
bd2d7cb247
Merge pull request #4014 from radarhere/arc
Fixed arc drawing bug for a non-whole number of degrees
2019-09-05 22:52:05 +03:00
Hugo van Kemenade
572a93c86f
Corrected tag counts (#4033)
Corrected tag counts
2019-09-05 22:41:16 +03:00
Hugo van Kemenade
3f9d00e4c2
Merge pull request #3967 from radarhere/error
Return after error
2019-09-04 16:07:22 +03:00
Konstantin Kopachev
06e34db10b
Merge remote-tracking branch 'upstream/master' into exif-writing-fixes
# Conflicts:
#	Tests/test_file_tiff_metadata.py
2019-08-29 09:20:09 -07:00
Andrew Murray
ddcfd259cf Corrected short and long range checks 2019-08-29 19:36:46 +10:00
Andrew Murray
35a7d11f43 Fixed typo [ci skip] 2019-08-29 19:02:19 +10:00
Andrew Murray
24d29bd11d
Merge pull request #4003 from djy0/master
Fix bug when merging identical images to GIF with a list of durations
2019-08-25 12:52:41 +10:00
Andrew Murray
2dbfabe6d5 Simplifications 2019-08-24 08:10:45 +10:00
Andrew Murray
d96f657328
Merge pull request #3998 from chadawagner/master
Fix bug in TIFF loading of BufferedReader
2019-08-23 06:25:30 +10:00
chadawagner
34330a7aa0
Update Tests/test_file_libtiff.py
Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2019-08-19 09:46:07 -07:00
Andrew Murray
f08a0966a0 Corrected tag counts 2019-08-19 21:12:16 +10:00
Andrew Murray
5b120164b5 Corrected underline [ci skip] 2019-08-17 20:32:24 +10:00
nulano
fa6b80fddf add option to capture all monitors on Windows 2019-08-15 20:03:33 +10:00
Konstantin Kopachev
1b626f4d22 Fix RATIONAL and SRATIONAL boundaries when writing IFDs 2019-08-12 19:43:35 +10:00
chadawagner
457a97dde8 added test for reading TIFF from non-disk file obj 2019-08-12 18:56:34 +10:00
djy0
0872cb4377 fix comment 2019-08-12 18:54:29 +10:00
djy0
63c15dc3ba format 2019-08-12 18:54:29 +10:00
djy0
3c971bec41 format 2019-08-12 18:54:29 +10:00
djy0
8696f06fbe Update test_file_gif.py 2019-08-12 18:54:29 +10:00
Andrew Murray
23872c0645 Do not allow floodfill to extend into negative coordinates 2019-08-12 06:51:16 +10:00
Andrew Murray
8fff9a2444 Fixed arc drawing bug for a non-whole number of degrees 2019-08-12 06:50:58 +10:00
Andrew Murray
27d6fc7bc5 Improved HSV conversion 2019-08-12 06:50:18 +10:00
Andrew Murray
f93a5d0972 Added text stroking 2019-07-29 06:40:03 +10:00
Andrew Murray
66ad3cb461 Changed overflow check to use PY_SSIZE_T_MAX 2019-07-17 07:07:26 +10:00
Hugo van Kemenade
1ab5670eb1
Introduce isort to automate import ordering and formatting (#3954)
Introduce isort to automate import ordering and formatting
2019-07-16 23:02:31 +03:00
Andrew Murray
2995fb67c1 Return after error 2019-07-13 13:50:13 +10:00
Andrew Murray
023dcf27c2 Raise the same error if a truncated image is loaded a second time 2019-07-13 08:37:17 +10:00
Jon Dufresne
d50445ff30 Introduce isort to automate import ordering and formatting
Similar to the recent adoption of Black. isort is a Python utility to
sort imports alphabetically and automatically separate into sections. By
using isort, contributors can quickly and automatically conform to the
projects style without thinking. Just let the tool do it.

Uses the configuration recommended by the Black to avoid conflicts of
style.

Rewrite TestImageQt.test_deprecated to no rely on import order.
2019-07-06 16:11:35 -07:00
nulano
0b0dc1112e Merge branch 'master' into revert-3931-update-freetype-epsilon
# Conflicts:
#	Tests/test_imagefont.py
2019-07-02 22:49:45 +02:00
nulano
d7c69ea2b4 skip test_unicode_extended on Python 2.x 2019-07-02 11:14:09 +02:00
nulano
22ce5cc0c7
Revert "Update epsilon for FreeType 2.10 with eg. Unicode width 16" 2019-07-02 11:08:48 +02:00
nulano
14ddfd30b2 fix lint 2019-07-02 09:31:05 +02:00
nulano
86d4c53d79 revert #3780 for PyPy as it hasn't been updated 2019-07-02 08:52:15 +02:00
Hugo
46535df8f3 Update epsilon for FreeType 2.10 with eg. Unicode width 16 2019-07-01 16:32:22 +03: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
Hugo
8d4bb339a6
Merge pull request #3780 from nulano/update_py_unicode
Update Py_UNICODE to Py_UCS4
2019-06-30 13:21:46 +03:00
Hugo
12695b8ca3
Merge pull request #3899 from radarhere/pixelsize
Consider I;16 pixel size when drawing
2019-06-30 13:18:46 +03:00
Hugo
f5a89a0e9a Use unittest asserts for consistency 2019-06-30 11:13:02 +03:00
Andrew Murray
c994b783ec
Merge branch 'master' into tiff-jpeg-quality 2019-06-30 14:03:09 +10:00
Andrew Murray
42588a6493 Skip test if libtiff is not installed 2019-06-30 13:26:58 +10:00
Andrew Murray
cc0d70145b Lint fixes 2019-06-30 13:26:58 +10:00
Christoph Gohlke
4a69223db9 Add test for sampleformat corruption 2019-06-30 13:26:58 +10:00
Andrew Murray
9074eda608
Merge pull request #3778 from radarhere/all_frames
Added ImageSequence all_frames
2019-06-30 07:55:34 +10:00
Andrew Murray
90d3d37164 Do not presume that the background color index is 0 2019-06-29 23:06:45 +10:00
Andrew Murray
97c15a245c Corrected color table size calculation 2019-06-29 23:02:26 +10:00
Andrew Murray
c3e982e0c6
Merge branch 'master' into master 2019-06-29 22:59:17 +10:00
Hugo
0e7358a046
Updated TIFF tile descriptors to match current decoding functio… (#3795)
Updated TIFF tile descriptors to match current decoding functionality
2019-06-29 10:27:00 +03:00
Hugo
08c47925d0
Added an image.entropy() method (#3608)
Added an `image.entropy()` method
2019-06-29 10:12:34 +03:00
Hugo
372c7c352a
Merge pull request #3703 from jkrshnmenon/master
Add an upper limit for blocks_max in _set_blocks_max
2019-06-27 23:03:25 +03:00
Hugo
b584635a8c
Merge pull request #3912 from radarhere/non_font_bytes
Fixed crash when loading non-font bytes
2019-06-27 22:40:29 +03:00
Andrew Murray
8b447c4840 Lint fixes 2019-06-26 19:16:36 +10:00
Alexander Böhn
7b815a5f1d Added an image.entropy() method
This calculates the entropy for the image, based on the histogram.

Because this uses image histogram data directly, the existing C
function underpinning the `image.histogram()` method was abstracted
into a static function to parse extrema tuple arguments, and a new
C function was added to calculate image entropy, making use of the
new static extrema function.

The extrema-parsing function was written by @homm, based on the
macro abstraction I wrote, during the discussion of my first
entropy-method pull request: https://git.io/fhodS

The new `image.entropy()` method is based on `image.histogram()`,
and will accept the same arguments to calculate the histogram data
it will use to assess the entropy of the image.

The algorithm and methodology is based on existing Python code:

* https://git.io/fhmIU

... A test case in the `Tests/` directory, and doctest lines in
`selftest.py`, have both been added and checked.

Changes proposed in this pull request:

* Added “math.h” include to _imaging.c
* The addition of an `image.entropy()` method to the `Image`
  Python class,
* The abstraction of the extrema-parsing logic of of the C
  function `_histogram` into a static function, and
* The use of that static function in both the `_histogram` and
  `_entropy` C functions.
* Minor documentation addenda in the docstrings for both the
  `image.entropy()` and `image.histogram()` methods were also
  added.
* Removed outdated boilerplate from testing code
* Removed unused “unittest” import
2019-06-26 19:15:47 +10:00
Andrew Murray
f22198e3bc Lint fixes 2019-06-26 19:09:02 +10:00
Andrew Murray
d591cf8d3f Error is not raised on 64-bit systems 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
590b5b7f9e test case for set_blocks_max 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
2acc098cab adding testcase for overflow 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
494fb25bdb adding testcase for overflow 2019-06-26 19:08:07 +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
Andrew Murray
25cf1010eb Lint fixes 2019-06-25 22:20:57 +10:00
nulano
983371d4d8 fix centos, amazon 2019-06-25 22:16:00 +10:00
nulano
be192d8f69 fix lint 2019-06-25 22:16:00 +10:00
nulano
5f65f10191 add test for #3777 2019-06-25 22:16:00 +10:00
Andrew Murray
d00e18b017 Updated test result 2019-06-23 14:01:51 +10:00
David Nisson
ddb61cfbd2 updated tests to match new tile descriptors 2019-06-23 13:59:20 +10:00
Andrew Murray
9c37933bb9 Added CMYK;16B and CMYK;16N unpackers 2019-06-23 11:56:17 +10:00
Andrew Murray
7bb16de81c Fixed crash when loading non-font bytes 2019-06-23 11:53:01 +10:00
Andrew Murray
db4916849e Added ImageSequence all_frames 2019-06-23 07:34:39 +10:00
Andrew Murray
e0cbfb2708 Consider I;16 pixel size when drawing 2019-06-23 07:33:55 +10:00
Andrew Murray
68fac40147 Fixed black formatting 2019-06-22 14:47:56 +10:00
Hugo
f5cd8b4b0d
Merge pull request #3909 from hugovk/run-black
Format code with Black
2019-06-22 06:46:15 +03:00
Andrew Murray
ea0f1c6b06 Do not presume that the last glyph has the max x value 2019-06-19 22:32:01 +10:00
Andrew Murray
fb38296230 Change direction of y offset in calculating size 2019-06-19 22:30:50 +10:00
Hugo
be1b551bfc
Add __main__.py to output basic format and support information (#3870)
Add __main__.py to output basic format and support information
2019-06-19 14:42:34 +03:00
Andrew Murray
da16b7ec45 Added variation font support 2019-06-19 20:27:49 +10:00
Hugo
488a0170a3 Format with Black 2019-06-19 09:30:10 +03:00
Hugo
1b99362f3d Merge remote-tracking branch 'upstream/master' into run-black 2019-06-19 09:29:28 +03:00
Hugo
f338eae128
Merge pull request #3869 from radarhere/imageshow
Do not down-convert if image is LA when showing with PNG format
2019-06-19 09:26:15 +03:00
Hugo
a9c05c7aa0
Merge pull request #3759 from radarhere/psd_frames
Improve handling of PSD frames
2019-06-19 09:15:13 +03:00
Hugo
ac6185ca15
Merge pull request #3897 from radarhere/load
Improved ICO and ICNS loading
2019-06-19 09:09:34 +03:00
Hugo
b2714854a3
Merge pull request #3856 from radarhere/ttb
Corrected ttb text positioning
2019-06-19 09:01:51 +03:00
Hugo
5631718a8d Format with Black 2019-06-13 18:54:46 +03:00
Hugo
77f946d8bc Format with Black 2019-06-13 18:54:24 +03:00
Hugo
f87821e010 Format with Black 2019-06-13 18:54:11 +03:00
Hugo
d08475442b Format with Black 2019-06-13 18:53:42 +03:00
Andrew Murray
b262378632 Added mode descriptors for all I;16 modes 2019-06-12 20:33:00 +10:00
Andrew Murray
e8af68bae2 Increased test coverage 2019-06-12 20:30:43 +10:00
Andrew Murray
e1e35cc819 Close internal fp when closing and deleting 2019-06-12 20:12:03 +10:00
Andrew Murray
ea02e28adb Use _min_frame in ImageSequence.Iterator 2019-06-12 20:11:51 +10:00
Andrew Murray
72d5ee3bfa Do not close exclusive fp after loading 2019-06-12 20:10:28 +10:00
Andrew Murray
f7d7a80b5b Allow ICNS to change size as ICO does 2019-06-12 02:19:58 +10:00
Andrew Murray
02a2e93703 Do not load ICO if already loaded 2019-06-12 02:18:54 +10:00
Andrew Murray
231fe4d62a Revert "Merge pull request #3838 from radarhere/i_conversion"
This reverts commit 41f3e7c8bd, reversing
changes made to 2f84482871.
2019-06-11 19:28:31 +10:00
Andrew Murray
54c83f61bd Check for raqm version function 2019-06-07 05:51:40 +10:00
Andrew Murray
1c1447f563 Corrected ttb text positioning 2019-06-07 05:51:40 +10:00
Andrew Murray
77630f000c Updated resampling filter error messages 2019-06-06 21:36:38 +10:00
Hugo
169961649d
Merge pull request #3848 from radarhere/pa
Improved palette handling for LA and PA modes
2019-06-05 22:32:44 +03:00
Hugo
41f3e7c8bd
Merge pull request #3838 from radarhere/i_conversion
Improved I mode conversion
2019-06-05 22:23:35 +03:00
Andrew Murray
e011fb155f Fixed typo 2019-06-05 19:32:50 +10:00
Hugo
23d4e6f4c4 Tighten fixed pyroma test 2019-06-02 22:36:05 +03:00
Jon Dufresne
1008644dd6 Add __main__.py to output basic format and support information
To help debug and show supported formats, users can run:

    $ python -m PIL

to get basic format and support information about the installed version
of Pillow.

The new feature works as follows:

    $ python -m PIL
    --------------------------------------------------------------------
    Pillow 6.1.0.dev0
    --------------------------------------------------------------------
    Python modules loaded from .../Pillow/src/PIL
    Binary modules loaded from .../Pillow/src/PIL
    --------------------------------------------------------------------
    Python 3.7.3 (default, May 11 2019, 00:38:04)
           [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]
    --------------------------------------------------------------------
    --- PIL CORE support ok
    --- TKINTER support ok
    --- FREETYPE2 support ok
    --- LITTLECMS2 support ok
    --- WEBP support ok
    --- WEBP Transparency support ok
    --- WEBPMUX support ok
    --- WEBP Animation support ok
    --- JPEG support ok
    --- OPENJPEG (JPEG2000) support ok
    --- ZLIB (PNG/ZIP) support ok
    --- LIBTIFF support ok
    --- RAQM (Bidirectional Text) support ok
    --------------------------------------------------------------------
    BLP
    Extensions: .blp
    Features: open
    --------------------------------------------------------------------
    BMP image/bmp
    Extensions: .bmp
    Features: open, save
    --------------------------------------------------------------------
    BUFR
    Extensions: .bufr
    Features: open, save
    --------------------------------------------------------------------
    …
2019-05-27 18:44:04 -07:00
Hugo
feb413e0f3
Merge pull request #3836 from radarhere/ico_size
Handle unexpected ICO image sizes
2019-05-12 19:53:48 +03:00
Andrew Murray
d830cca5ca Handle unexpected ICO image sizes 2019-05-12 20:44:29 +10:00
Andrew Murray
e131fa22e2 Fixed reading and saving for TIFF and IM in PA mode 2019-05-11 14:43:48 +10:00
Andrew Murray
e9c0cf61f3 Fixed palette for LA and PA mode when pickling 2019-05-11 14:43:00 +10:00
Konstantin Kopachev
5e5ff10f09 Fix bits value for RGB;16N unpackers 2019-05-10 08:07:01 +10:00
Andrew Murray
2787b9b991 Added tests 2019-05-08 21:59:16 +10:00
Andrew Murray
ddc83fd8a7 Updated ImageMath tests for scaled I mode conversion 2019-05-08 21:58:50 +10:00
Andrew Murray
8a035b8c5d Improved I mode conversion 2019-05-08 21:58:33 +10:00
Hugo
45df9ad882
Merge pull request #3807 from radarhere/code
Simplified code
2019-05-04 18:57:40 +03:00
Hugo
fdcacb6978
Merge pull request #3817 from radarhere/cmyk_16l
Added reading of CMYK;16L TIFF images
2019-05-04 18:53:13 +03:00
Hugo
d45a13d9cb
Merge pull request #3827 from radarhere/pdf
Fixed dimensions of 1-bit PDFs
2019-05-04 18:52:16 +03:00
Hugo
9a25b3c797
Merge pull request #3825 from radarhere/path
Fixed opening mmap image through Path on Windows
2019-05-04 18:51:23 +03:00
Hugo
c3ed8cc67e
Fixed ImageDraw arc gaps (#3824)
Fixed ImageDraw arc gaps
2019-05-04 18:50:07 +03:00
Hugo
5090bba463
Merge pull request #3822 from radarhere/tile
Expand GIF to include frames with extents outside the image size
2019-05-04 18:46:49 +03:00
Hugo
3e4b1a91ad
Merge pull request #3814 from radarhere/getimage
Fixed ImageTk getimage
2019-05-04 18:39:29 +03:00
Hugo
ab9a25d623
Merge pull request #3791 from radarhere/int
Fixed bug in decoding large images
2019-05-04 16:15:32 +03:00
Hugo
0ccd887431
Merge pull request #3771 from radarhere/app13
Fixed reading APP13 marker without Photoshop data
2019-05-04 16:10:02 +03:00
Andrew Murray
124c1f6bce Added tests 2019-05-04 23:05:41 +10:00
Andrew Murray
683768095b Removed duplicate code 2019-05-04 23:05:07 +10:00
Hugo
82d9ea5eac
Merge pull request #3808 from radarhere/imagegrab
Added option to include layered windows in ImageGrab.grab on Windows
2019-05-04 16:00:43 +03:00
Hugo
9077a80e3e
Merge pull request #3787 from radarhere/raqm
Fixed raqm layout bug
2019-05-04 15:57:13 +03:00
Hugo
e20228a60a
Merge pull request #3785 from radarhere/unicode_path
Fixed loading font with non-Unicode path on Windows
2019-05-04 15:55:50 +03:00
Andrew Murray
ae1f7c4f50 Fixed dimensions of 1-bit PDFs 2019-05-04 16:27:34 +10:00
Andrew Murray
691df96734 Fixed opening mmap image through Path on Windows 2019-05-04 15:00:49 +10:00
Andrew Murray
21c7fd251c Fixed arc gaps 2019-05-03 23:37:37 +10:00
Andrew Murray
27134340f5 Expand GIF to include frames with extents outside the image size 2019-05-02 19:46:17 +10:00
Andrew Murray
ca0d28eae5 Added reading of CMYK;16L TIFF images 2019-05-01 00:42:30 +10:00
Andrew Murray
d9a3878937 Fixed ImageTk getimage 2019-04-29 23:43:13 +10:00
Andrew Murray
70038bd71e Added option to include layered windows in ImageGrab.grab on Windows 2019-04-26 20:09:46 +10:00
Andrew Murray
ca1cf59251 Changed decode buffer size to Py_ssize_t 2019-04-15 17:33:28 +10:00
Andrew Murray
73cb0ce15f Fixed numpy bool bug 2019-04-13 00:25:59 +10:00
Andrew Murray
b742d1511e Fixed raqm layout bug 2019-04-11 15:36:33 +10:00
Andrew Murray
4e6aa7d6d3 Fixed loading font with non-Unicode path on Windows 2019-04-10 07:04:59 +10:00
Riley Lahd
5fb36d2de4 Merge branch 'master' of https://github.com/python-pillow/Pillow 2019-04-09 08:24:52 -06:00
Hugo
b636dde501
Merge pull request #3765 from hugovk/rm-eol-trusty
Drop support for EOL Ubuntu 14.04 (Trusty Tahr)
2019-04-06 13:19:21 +03:00
Andrew Murray
2274c2afc7 Fixed reading APP13 marker without Photoshop data 2019-04-05 20:02:45 +11:00
Andrew Murray
4f3b44960f Resolved segfaults 2019-04-02 09:25:27 +11:00
Hugo
1c3da86ae7 Remove workaround for EOL Trusty/Precise 2019-04-01 17:45:32 +03:00
Andrew Murray
40bc46ff49 Moved ImageFile.Exif to Image.Exif 2019-04-01 20:03:02 +11:00
Andrew Murray
8f0db65cd7 Allow exif_transpose to work on Image instances as well as ImageFile 2019-04-01 19:37:25 +11:00
Andrew Murray
38fb9b1030 Delete EXIF orientation tag after transposing 2019-04-01 18:49:09 +11:00
Hugo
c8257b30dd
Merge pull request #3687 from radarhere/exif_transpose
Add ImageOps exif_transpose method
2019-04-01 10:23:33 +03:00
Hugo
7d378a8e4c
Merge pull request #3625 from radarhere/exif
Add EXIF class
2019-04-01 10:20:05 +03:00
Andrew Murray
f707affbde
Merge pull request #3615 from hugovk/imagecms-deprecations
Add warnings to deprecated CMS profile attributes
2019-04-01 17:35:32 +11:00
Hugo
4f8cfd536b
Merge pull request #3721 from radarhere/quantize
Update palette in quantize
2019-03-30 12:07:38 +02:00
Hugo
05849ca794
Merge pull request #3714 from radarhere/tiff_frames
Improvements to TIFF is_animated and n_frames
2019-03-30 12:04:16 +02:00
Hugo
69ed0aa5b5
Merge pull request #3728 from radarhere/pa_mode
Improvements to PA and LA conversion and palette operations
2019-03-30 12:00:06 +02:00
Andrew Murray
c96cdb5e77 Consistent DPI rounding 2019-03-30 15:03:57 +11:00
Andrew Murray
dba38912fb Allow putpalette for LA and PA 2019-03-29 23:13:50 +11:00
Andrew Murray
819b8acd26 Improved PA conversion 2019-03-29 23:13:07 +11:00
Alex Clark
c8ee701013
Merge pull request #3752 from hugovk/update-classifiers
Update Trove licence classifiers
2019-03-28 14:18:58 -04:00
Andrew Murray
64910d1921 Parse Nintendo and Fujifilm MakerNote tags 2019-03-28 21:13:12 +11:00
Andrew Murray
3caec4344e Added get_ifd method to access embedded IFDs 2019-03-28 21:13:12 +11:00
Andrew Murray
d5db62be7b Added EXIF class 2019-03-28 21:13:12 +11:00
Hugo
3b92de5ddc
Merge pull request #3588 from radarhere/mpo_frame_size
Change size of MPO image to match frame
2019-03-28 12:01:33 +02:00
Hugo
ace5ba4418
Merge pull request #3701 from radarhere/photoshop
Read Photoshop resolution data
2019-03-28 11:55:13 +02:00
Hugo
a93bcdfe0c
Merge pull request #3724 from radarhere/readonly_save
Ensure image is mutable before saving
2019-03-28 11:53:33 +02:00
Hugo
0572983104
Merge pull request #3726 from radarhere/pa
Promote P images to PA in putalpha
2019-03-28 11:44:52 +02:00
Andrew Murray
a5b62857b0 Change size of MPO image to match frame 2019-03-28 08:33:17 +11:00
Andrew Murray
d84fd20f0c Simplified is_animated 2019-03-28 08:13:47 +11:00
Hugo
adbe97594e
Merge pull request #3719 from radarhere/p_rgb_rgba
Allow RGB and RGBA values for new P images
2019-03-27 18:03:23 +02:00
Hugo
82848905e6
Merge pull request #3713 from radarhere/tiff_seek
Fixed TIFF bug when seeking backwards and then forwards
2019-03-27 17:58:34 +02:00
Hugo
90886b1888
Merge branch 'master' into imagecms-deprecations 2019-03-27 12:03:54 +02:00
hugovk
b21ea99fd9 Relax incorrect pyroma test 2019-03-26 22:59:59 +02:00
Andrew Murray
4a5666f1f4 Added transparency for all PNG greyscale modes 2019-03-27 07:41:33 +11:00
Andrew Murray
8ba76f9a10 Added support for I;16 modes for remaining transpose operations 2019-03-23 14:13:39 +11:00
Andrew Murray
31ac5a96d1
Merge pull request #3716 from radarhere/gif_rewind
Fixed GIF bug when rewinding to a non-zero frame
2019-03-23 10:46:41 +11:00
Riley Lahd
ad70fc73cb Linting changes 2019-03-22 08:26:16 -06:00
Riley Lahd
4b2746fc39 Remove disposal 2 duplicate frame exemption and add true delta test 2019-03-22 08:19:01 -06:00
Andrew Murray
15f8ef02c9 Updated freetype to 2.10.0 2019-03-22 21:14:39 +11:00
Andrew Murray
f61828acdc Promote P images to PA in putalpha 2019-03-19 11:13:58 +11:00
Hugo
b8ea8814f0
Merge pull request #3683 from radarhere/exclusive
Only close original fp in __del__ and __exit__ if original fp is exclusive
2019-03-18 20:37:21 +02:00
Jon Dufresne
6d46ae2e8f Fix BytesWarning in Tests/test_numpy.py
When running Python with the `-b` command line argument, fixes warnings:

    Tests/test_numpy.py::TestNumpy::test_1bit
      Pillow/Tests/test_numpy.py:118: BytesWarning: Comparison between bytes and string
        arr_bool = numpy.array([[1, 0, 0, 1, 0], [0, 1, 0, 0, 0]], 'bool')

    Tests/test_numpy.py::TestNumpy::test_point_lut
      Pillow/Tests/test_numpy.py:170: BytesWarning: Comparison between bytes and string
        lut = numpy.array(data, dtype='uint8')

    Tests/test_numpy.py::TestNumpy::test_to_array
      Pillow/Tests/test_numpy.py:146: BytesWarning: Comparison between bytes and string
        self.assertEqual(np_img.dtype, numpy.dtype(dtype))
2019-03-17 10:08:33 -07:00
Andrew Murray
0b62337b6f Ensure image is mutable before saving 2019-03-17 23:37:40 +11:00
Andrew Murray
7dfbdc01f4 Fixed bug when rewinding to a non-zero frame 2019-03-16 20:02:24 +11:00
Andrew Murray
5b9c11b426 Update palette in quantize 2019-03-16 13:36:58 +11:00
Andrew Murray
6790c2e375 Allow RGB and RGBA values for new P images 2019-03-15 17:35:05 +11:00
Andrew Murray
0b630e06dc Test that background colours read are equal to saved colours 2019-03-15 10:29:33 +11:00
Riley Lahd
85a07bb385 Linting changes 2019-03-14 14:51:13 -06:00
Riley Lahd
96c5a4c543 Add test for disposal mode 2 gifs 2019-03-14 14:40:31 -06:00
Andrew Murray
0ad09f7386
Merge branch 'master' into mime-types 2019-03-15 07:06:59 +11:00
Andrew Murray
ab85290911 Fixed bug when seeking backwards and then forwards 2019-03-13 18:54:09 +11:00
Hugo
e3eac00b1f
Merge pull request #3566 from radarhere/i16
Added I;16 PNG save
2019-03-12 12:25:53 +02:00
Hugo
b3587f0fb7
Merge pull request #3705 from radarhere/bmp
Add support for BMP RGBA bitfield compression
2019-03-12 11:36:04 +02:00
Andrew Murray
ce9dd67540 Added I;16 PNG save 2019-03-12 17:28:42 +11:00
Ben Yang
9f390a5192 uncommented test 2019-03-11 18:56:22 -07:00
Ben Yang
5cdbec0cfe added test for attempting to apply complex settings to fonts when using basic layout engine 2019-03-11 18:56:22 -07:00
Ben Yang
386492ff54 wrong test_language.png committed, whoops! fixed 2019-03-11 18:56:22 -07:00
Ben Yang
7324a32443 fixed some whitespace to pass linting 2019-03-11 18:56:22 -07:00
Ben Yang
8624efd283 added ability to set language for text rendering 2019-03-11 18:55:46 -07:00
Andrew Murray
22b0110f89 Only close original fp in __del__ and __exit__ if original fp is exclusive 2019-03-12 08:54:43 +11:00