Commit Graph

173 Commits

Author SHA1 Message Date
Andrew Murray
37b293f593 Flake8 fixes 2017-04-20 21:14:23 +10:00
wiredfool
86c1704646 add _close_exclusive_fp_after_load flag 2017-04-03 08:06:58 -07:00
wiredfool
b69b70198f Closing only single frame TIFF images 2017-03-14 23:17:22 +00:00
homm
58484db509 close files after loading for some file types 2017-03-12 20:05:20 +00:00
Andrew Murray
bef530cb09 Changed None comparison to is 2017-03-03 21:38:19 +11:00
wiredfool
0ee223aa7a Merge pull request #1390 from radarhere/deprecated_27
Removed use of spaces in TIFF kwargs, deprecated in 2.7
2017-02-22 10:13:45 +00:00
Marcus Brinkmann
8a9bd2cdcd Default to inch-interpretation for missing ResolutionUnit in TiffImagePlugin. 2017-01-19 17:24:28 +01:00
Andrew Murray
58b5c9187d Replaced absolute PIL imports with relative imports (#2349) 2017-01-17 13:22:18 +00:00
wiredfool
55f7a736a4 Merge pull request #2234 from radarhere/print
Updated comments to use print as a function
2016-12-13 20:00:25 +00:00
Andrew Murray
41e492b026 Removed use of spaces in TIFF kwargs, deprecated in 2.7 2016-12-09 20:44:42 +11:00
wiredfool
86606022c5 Merge pull request #2193 from SemanticsOS/lambdafu/libtiff-icc
Update info.icc_profile when using libtiff reader.
2016-12-03 13:44:26 +00:00
wiredfool
e0b957240b Merge pull request #2087 from cskau/patch-1
Fixes TIFFImagePlugin ICC color profile saving.
2016-11-29 19:33:52 +00:00
Andrew Murray
4ed31e8ef7 Updated comments to use print as a function 2016-11-26 11:02:44 +11:00
Jon Dufresne
dbe9f85c7d Drop support for Python 2.6
* Drop unittest2 requirement
* Use set literals
* Use dict/set comprehension
* Use str.format() automatic numbering
2016-11-22 04:23:55 -08:00
Jon Dufresne
ffa5bc2726 Use generator expressions instead of list comprehension
Avoids unnecessary temporary lists in memory.
2016-11-14 18:11:15 -08:00
Andrew Murray
8fc90fe4fa Replaced range(len()) 2016-11-06 12:38:59 +11:00
Clement Skau
caf53b05ec Fixes TIFFImagePlugin ICC color profile saving.
In the TIFF code saving icc_profile is conditional on tag_v2 being set which doesn't make sense to me. I believe this is merely an indentation typo.

I've been trying to save TIFFs with im.info['icc_profile'] set and compression=raw, but unfortunately this results in TIFFs without ICC color profiles.
With the attached patch TIFFs with said conditions will be saved with the profile set in im.info['icc_profile'].

Note: There are a number of different conditions that need to be met for code to succeed in saving with the profile since it branches between using libtiff and ImageFile._save(..), and the libtiff code does not currently save the ICC color profile.
For instance setting compression=tiff_lzw will result in using libtiff and no profile will be saved.
2016-11-05 15:01:39 +09:00
Marcus Brinkmann
66de02685f Update info.icc_profile when using libtiff reader. 2016-11-04 16:37:49 +01:00
Jon Dufresne
e44bb42ae9 Replace type() equality checks with isinstance 2016-10-31 06:41:43 -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
wiredfool
2db3f00e92 Merge pull request #2141 from wiredfool/tiff_fd
Move libtiff fd duplication to _load_libtiff
2016-10-03 06:03:50 -07:00
wiredfool
41cbd4f4d3 Only duplicate the file descriptor when acually passing it to
libtiff.  From: Sebastian Krause <sebastian@realpath.org>
2016-09-29 22:14:51 +01:00
wiredfool
4a90e8f75b Merge pull request #2024 from uploadcare/fix-empty-exif-tags
Skip empty values in ImageFileDirectory
2016-09-29 08:24:44 -07:00
Marcus Brinkmann
92c7337df0 Add TIFF save_all writer. 2016-09-29 17:05:33 +02:00
Antony Lee
7e9c944caf Fix saving originally missing TIFF tags.
Don't incorrectly set the tag type to None if it was originally missing.
2016-09-19 00:31:17 -07:00
homm
c2b4ff5fa4 skip empty values in ImageFileDirectory 2016-07-12 18:09:02 +03:00
wiredfool
c50503a14d API change/revert: Bytes should be returned as a single byte string, not a tuple of integers 2016-06-26 12:06:56 +01:00
Andrew Murray
b1a528bf10 Changed variable names to avoid redefining builtins 2016-05-10 22:31:36 +10:00
wiredfool
14f3b45f46 Merge pull request #1789 from zwhfly/tiff
Add Support for 2/4 bpp Tiff Grayscale Images
2016-04-03 12:07:48 -07:00
Andrew Murray
26bf1937c7 Added warning for deprecated as_dict method 2016-04-03 23:41:28 +10:00
Andrew Murray
677b958a7f Health fixes 2016-04-01 21:49:30 +11:00
zwhfly
aa0636d811 Add Tiff Encodings for 2/4 Bit Grayscale Images
Added decoding support for 2/4 bit grayscale tiff images, including inverted and/or bit-order-reversed formats.
2016-03-29 20:19:22 +08:00
zwhfly
46134f78d2 Rearrange Tiff Encodings List
Refined the order of items in the dict 'OPEN_INFO'.
2016-03-29 20:19:21 +08:00
Andrew Murray
886a7cf206 Different TIFF frames may have different compression 2016-03-27 22:18:39 +11:00
wiredfool
9fa6634f4d Partial fix for #1597
Haven't excercized all of the metadata that we're allowing yet,
and there's clearly still something up with Arrays, as one
of them is still crashing and making it impossible to save a
palette with a libtiff image.
2015-12-30 07:54:14 -08:00
wiredfool
80ab12bdc0 Lookup tag info in both _v2(info) and original(name only) dicts, delegate to lookup 2015-12-29 22:02:11 +00:00
wiredfool
3ac9396e8c Write round trip for rationals, including nan value 2015-12-29 22:00:36 +00:00
wiredfool
bd05d66c7e Python 3.4 support for the IFDRational 2015-12-29 21:33:10 +00:00
wiredfool
79608bd762 Make numerator/denominator read only 2015-12-27 10:21:32 +00:00
wiredfool
722ee8240b Inherit from Rational instead of Fraction, some basic tests. Fixes Py2.6 2015-12-27 10:21:32 +00:00
wiredfool
f9fe4da8b2 Make IFDRational hashable 2015-12-27 10:21:32 +00:00
wiredfool
3bbb9e676f value based equivalence 2015-12-27 10:21:32 +00:00
wiredfool
deecbcd3a3 Added a rational class for TiffIFD that allows for 0/0 2015-12-27 10:21:31 +00:00
wiredfool
fe35a18db0 Possible fix for issue #1561, let rows per strip through, but block the other two 2015-12-14 20:25:00 +00:00
wiredfool
7206be535e Flatten sampleformat to initial value, fixes #1466 2015-10-03 22:57:44 +01:00
wiredfool
4a8a983e6a Merge pull request #1398 from mrTable/master
Check flush method existence for file-like object
2015-10-01 07:54:26 -07:00
wiredfool
ca929bdfc0 Merge pull request #1435 from radarhere/tiff
Minor Tiff formatting changes
2015-09-29 15:43:40 +01:00
Andrew Murray
1306f7d6af Updated URLs for redirects 2015-09-28 21:53:25 +10:00
Andrew Murray
d097d44fa1 Updated documentation and removed deprecated comment 2015-09-23 22:14:06 +10:00
Andrew Murray
a5bac62bc3 Flake8 fixes 2015-09-23 20:46:01 +10:00