Commit Graph

315 Commits

Author SHA1 Message Date
wiredfool
fdc6e149fb Fix bad merge -- undoes minor speedup of copy instead of crop 2017-06-21 02:36:12 -07:00
wiredfool
c70977aad7 added decompression bomb check to crop 2017-06-21 02:36:11 -07:00
wiredfool
26050f25bd Merge pull request #2409 from wiredfool/draft
Clarify that draft is only implemented for JPEG and PCD
2017-06-13 22:24:02 +01:00
wiredfool
7622885f3c s/warning/note/ 2017-06-13 14:23:18 -07:00
Jon Dufresne
d244fbb299 Remove unnecessary calls to dict.keys()
iter(dict) is equivalent to iter(dict.keys()), so simply act on the dict
instead of adding the extra call.

Inspired by Lennart Regebro's PyCon 2017 presentation "Prehistoric
Patterns in Python". Available at:

https://www.youtube.com/watch?v=V5-JH23Vk0I
2017-05-28 09:55:38 -07:00
wiredfool
dd5bfec11c save_ppm doesn't take kwargs 2017-05-13 14:22:18 +01:00
Hin-Tak Leung
9f8aeb5d8e put compress_level=1 inside Image._dump()
Better alternative to setting compress_level=1 than the secret handshake
in the last attempt.

The last in a series of changes to fix
https://github.com/python-pillow/Pillow/issues/2508
2017-05-13 14:22:18 +01:00
Andrew Murray
37b293f593 Flake8 fixes 2017-04-20 21:14:23 +10:00
wiredfool
df616d2b16 Merge pull request #2471 from radarhere/crop
Return copy on Image crop if crop dimensions match the image
2017-04-19 11:46:07 +01:00
wiredfool
0834e9491e Merge pull request #2330 from wiredfool/pr_2032
Close files after loading when possible.
2017-04-03 23:32:06 +01:00
wiredfool
06b61f4e5b close the mmap when closing the image #2194 2017-04-03 08:06:59 -07:00
wiredfool
86c1704646 add _close_exclusive_fp_after_load flag 2017-04-03 08:06:58 -07:00
Andrew Murray
4dd7b94338 Return copy on Image crop if crop dimensions match Image dimensions 2017-03-31 13:02:56 +11:00
Christoph Gohlke
140c4b54c0 Remove superfluous import of FixTk
The `_imaging` module does not link against libtcl/libtk.
`FixTk` is imported by `import Tkinter` if necessary.
The `FixTk` module is for Python 2.x on Windows only.
2017-03-22 10:15:29 -07:00
homm
58484db509 close files after loading for some file types 2017-03-12 20:05:20 +00:00
homm
88ec0bb52f close file in case of failures 2017-03-12 20:05:20 +00:00
wiredfool
c9f54c98a5 Merge pull request #1938 from wiredfool/python-decoder
Pure Python Decoders - fix for MSP decoding
2017-03-12 17:20:19 +00:00
wiredfool
b668db33cd Updated versionadded to reflect 6-9 month slip [ci skip] 2017-03-11 13:50:19 +00:00
wiredfool
25bc5c76ab Pure python decoder registry 2017-03-11 13:50:19 +00:00
wiredfool
1e9afb3ecb Refactor out the palette remapping to Image.Image 2017-03-08 19:41:18 +11:00
Hugo
cb34b686a5 Merge pull request #1822 from radarhere/unused
Remove unused imports
2017-02-26 10:05:19 +02:00
Andrew Murray
f9a99652e4 Replaced KeyError catch with dictionary get method 2017-02-25 13:49:05 +11:00
hugovk
0764b2b5e9 Update error message 2017-02-22 08:20:45 +02:00
wiredfool
f0cebebf32 Clarify that draft is only implemented for JPEG and PCD 2017-02-17 06:22:40 -08:00
ces42
8fb44a2bee More explicit error message when saving to a file with invalid extension (#2399)
* more explicit error message when saving to a file with invalid extension + test
2017-02-17 13:39:16 +00:00
hugovk
07af06bf8c Expose and test radial_gradient 2017-01-29 18:44:24 +02:00
hugovk
3ead178d18 flake8 2017-01-29 18:38:06 +02:00
hugovk
47b1c66961 Expose and test linear_gradient 2017-01-29 18:17:31 +02:00
Andrew Murray
c168f01111 Removed imports used only by comments 2017-01-18 20:06:47 +11:00
Andrew Murray
58b5c9187d Replaced absolute PIL imports with relative imports (#2349) 2017-01-17 13:22:18 +00:00
Luis G
67c1258cfc Expose registered file extensions
This adds a new method in Image (registered_extensions) that exposes the
internal EXTENSION dictionary to consumers of the library
2017-01-07 11:32:16 +11:00
wiredfool
fed4b52171 Disable fastpath when using center or translate 2017-01-01 11:13:25 +00:00
wiredfool
f286d8bb34 Documentation param order to match actual order 2017-01-01 11:10:39 +00:00
Marcus Brinkmann
90077b3975 Add center and translate option to Image.rotate. 2016-12-31 19:01:09 +00:00
wiredfool
69bea50810 Allow 0 size images, Fixes #2259 2016-12-31 13:19:29 +00:00
Andrew Murray
4ed31e8ef7 Updated comments to use print as a function 2016-11-26 11:02:44 +11:00
Hugo
fb54b1da2e Merge pull request #2248 from uploadcare/use-_new
Use Image._new() instead of _makeself()
2016-11-24 08:32:13 +02:00
homm
d4784bffb2 return copy of the image if size matches 2016-11-24 03:30:36 +03:00
homm
14734b1d97 remove _makeself deprecated method 2016-11-24 03:03:31 +03:00
homm
5773fd8396 _makeself → _new 2016-11-23 14:41:43 +03:00
Andrew Murray
38fd77ca7d Fixed bug in saving to fp-objects in Python >= 3.4 2016-11-15 20:13:25 +11:00
Andrew Murray
c3fe5d4313 Changed behaviour of default box argument for paste method to match docs 2016-11-15 06:37:40 +11:00
Hugo
48b72eac34 Merge pull request #2184 from jdufresne/isinstance
Replace type() equality checks with isinstance
2016-11-01 19:07:06 +02:00
Tim Graham
02b5ce0479 Remove redundant space in PIL.Image ImportError message 2016-10-31 11:09:40 -04:00
Jon Dufresne
e44bb42ae9 Replace type() equality checks with isinstance 2016-10-31 06:41:43 -07:00
Matt R. Wilson
74f751037f Divide floats to eliminate deprecation warning.
When running python 2.7 with the `-3` flag the following warning occurs
> .../PIL/Image.py:48: DeprecationWarning: classic int division
  MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 / 4 / 3)

Simply changing the 4 and 3 to be floats instead eliminates the warning
and, because the result is cast, the resulting `int` stays the same for
python 2 and 3.
2016-10-22 11:58:13 -04:00
homm
c5e111e6b8 allow lists as arguments for Image.new 2016-10-04 03:06:35 +03:00
wiredfool
445451c0b9 Added common check for size tuple errors 2016-10-03 07:27:02 -07:00
wiredfool
d9fc1848a2 Merge pull request #2140 from SemanticsOS/lambdafu/tiff-multipage
Add TIFF save_all writer.
2016-10-03 06:31:39 -07:00
Eric Soroos
95b50bf611 Make Image.crop an immediate operation, not lazy. Fixes #1077 2016-09-29 13:28:24 -07:00