Commit Graph

31 Commits

Author SHA1 Message Date
Jon Dufresne
cecdb2af61 Send unwanted subprocess output to /dev/null
Avoids unnecessary creation of temporary files as well as unnecessarily
storing process output in memory. The temporary files would sometimes
remain and not be cleaned up.
2017-01-26 17:31:29 -08:00
Andrew Murray
58b5c9187d Replaced absolute PIL imports with relative imports (#2349) 2017-01-17 13:22:18 +00:00
Andrew Murray
a06dd59df7 Added context managers 2016-12-28 09:54:10 +11:00
Andrew Murray
b58f76dc4f Renamed references to OS X to macOS 2016-09-23 21:12:03 +10:00
Andrew Murray
d21430234e Improved consistency of checks for flush 2015-09-02 23:48:22 +10:00
Andrew Murray
fa73879d19 Changed register calls to use format property 2015-07-04 23:29:58 +10:00
Andrew Murray
3c7e37d2d7 Replaced old-style classes 2015-05-27 00:07:21 +10:00
Andrew Murray
ee34d6843b Further health fixes 2015-04-24 18:24:52 +10:00
hugovk
63f6e94be4 Flake8 after PR #1185 2015-04-23 13:25:45 +03:00
Andrew Murray
1bcda962d2 Updated IcnsImagePlugin documentation 2015-04-23 17:04:03 +10:00
Andrew Murray
689f28aae7 Added icns save 2015-04-12 12:58:46 +10:00
hugovk
8de95676e0 flake8 2014-08-26 16:47:10 +03:00
wiredfool
205e056f8f Icns DOS fix -- CVE-2014-3589
Found and reported by Andrew Drake of dropbox.com
2014-08-13 09:25:11 -07:00
wiredfool
54173d2c67 Cherry-pick of portions of patch a500ca1393, many shortcut ops added, no functional changes 2014-05-09 21:36:15 -07:00
Alastair Houghton
172e46def8 Fixed a silly mistake. 2014-03-28 09:30:16 +00:00
Alastair Houghton
5aac5b7eff Made JPEG2K support for files conditional on its inclusion in pillow build. Added a JPEG2K icon test. 2014-03-28 09:09:55 +00:00
Alastair Houghton
cbe7e93bdd Merge branch 'icns-support' into icns+jp2k 2014-03-26 11:18:26 +00:00
Alastair Houghton
3655a0ecce Fixed a pre-existing Python 3 bug. 2014-03-26 11:12:14 +00:00
Alastair Houghton
5904ac1718 Added some tests and a couple of icns files. 2014-03-26 10:49:39 +00:00
Alastair Houghton
18f12b30aa The JPEG plug-in will seek the stream if it's an fd, so change to using an io.BytesIO. 2014-03-24 18:04:37 +00:00
Alastair Houghton
5f77c39090 Added JPEG 2000 support for .icns files. 2014-03-24 17:24:49 +00:00
Alastair Houghton
9b5bc2012f Removed print statements. 2014-03-24 17:13:14 +00:00
Alastair Houghton
299c278e66 Improved icns support 2014-03-24 16:10:23 +00:00
Alex Clark
3020c16eaa Fix imports 2013-03-07 11:20:28 -05:00
Brian Crowell
a7e3b2e47b py3k: The big push
There are two main issues fixed with this commit:

* bytes vs. str: All file, image, and palette data are now handled as
  bytes. A new _binary module consolidates the hacks needed to do this
  across Python versions. tostring/fromstring methods have been renamed to
  tobytes/frombytes, but the Python 2.6/2.7 versions alias them to the old
  names for compatibility. Users should move to tobytes/frombytes.

  One other potentially-breaking change is that text data in image files
  (such as tags, comments) are now explicitly handled with a specific
  character encoding in mind. This works well with the Unicode str in
  Python 3, but may trip up old code expecting a straight byte-for-byte
  translation to a Python string. This also required a change to Gohlke's
  tags tests (in Tests/test_file_png.py) to expect Unicode strings from
  the code.

* True div vs. floor div: Many division operations used the "/" operator
  to do floor division, which is now the "//" operator in Python 3. These
  were fixed.

As of this commit, on the first pass, I have one failing test (improper
handling of a slice object in a C module, test_imagepath.py) in Python 3,
and three that that I haven't tried running yet (test_imagegl,
test_imagegrab, and test_imageqt). I also haven't tested anything on
Windows. All but the three skipped tests run flawlessly against Pythons
2.6 and 2.7.
2013-01-10 08:46:56 -06:00
Brian Crowell
83ff0b3b31 py3k: Use relative imports
In py3k, imports are absolute unless using the "from . import" syntax.

This commit also solves a recursive import between Image, ImageColor, and
ImagePalette by delay-importing ImagePalette in Image.

I'm not too keen on this commit because the syntax is ugly. I might go back
and prefer the prettier "from PIL import".
2013-01-10 08:46:48 -06:00
Brian Crowell
abd215e457 py3k: Remove tuples in parameter lists
Py3k no longer supports unpacking tuples in the parameters.
2013-01-10 08:46:47 -06:00
Brian Crowell
09f1081c95 py3k: Fix up uses of dictionary views, ranges, and has_key()
y.has_key(x) is gone (use x in y), and keys(), values(), items(), and
range() all return views.

Some iterables needed to be packed into lists, either because the code
expected a list (such as "range(256) * 3") or because the original
collection was being modified (automatic global declarations).

The Tiff ImageFileDictionary is a special case and will be dealt with in
another commit.
2013-01-10 08:46:42 -06:00
Brian Crowell
78575798d7 py3k: Update exception usage to modern syntax 2013-01-10 08:46:33 -06:00
Brian Crowell
37f22ebfcd py3k: Use string methods instead of string module
First, we go for the obvious stuff. The string module methods are gone in
3.0, so we translate them to the appropriate methods on the string class.
2013-01-10 08:42:49 -06:00
Alex Clark
9a640e3157 Forking PIL 2010-07-30 22:52:47 -04:00