Commit Graph

108 Commits

Author SHA1 Message Date
wiredfool
9bb4c51629 module level default api level 2015-09-11 22:39:37 +01:00
wiredfool
0c942911d9 fixed the rebase 2015-09-11 22:39:37 +01:00
Antony Lee
1b9b3749ca Reorder OPEN_INFO to cover both endiannesses.
By interleaving little and big-endian entries we make sure entries
exist for both cases.  Some additional entries created when the
big-endian was missing.  I am not sure of what entry to create for the
big-endian, 4-bit case (what is the order of the two entries within the
byte?).
2015-09-11 22:39:37 +01:00
Antony Lee
6309bfe921 Support too long ExtraSamples.
Some programs generate SamplesPerPixel entries in ExtraSamples instead
of SamplesPerPixel-3, cf. #1227.  This is a stopgap measure to support
them.  One could also decide to add generic code to always support
having SamplesPerPixel entries (by dropping the first 3).
2015-09-11 22:39:37 +01:00
Antony Lee
93abbd0caa Restore legacy TIFF API.
To have the old API that always returns tuples, and fractions as pairs,
set the `legacy_api` attribute of the IFD to True.

This should alleviate concerns about backwards compatibility.
2015-09-11 22:39:37 +01:00
Antony Lee
d5b46dce96 Fix MPO support, and Python2.6 support. 2015-09-11 22:34:50 +01:00
Antony Lee
56a3f0f2ab Fix EXIF support. 2015-09-11 22:34:50 +01:00
Antony Lee
974bcc074b Major rewrite of TIFF ImageFileDirectory.
Do not represent scalar tags as 1-element tuples.  Keep tag
type and count information in TiffTags.TAGS.  Normalize data in
ImageFileDirectory.__setitem__: wrap and unwrap tuples as needed,
convert rationals to floats.  (To ensure consistency, make the "tags"
attribute private.)  Interpret byte data as a series of integers rather
than a bytearray (which should only map to the "undefined" type).  On
Python3, if a str is assigned to an "undefined" tag, encode it as ASCII.

Note that a large number of tags have been removed from TiffTags.TAGS
because I do not have time to figure out the type and count of each of
them.  They should be restored before this gets merged in.

This obviously breaks backwards compatibility in a lot of ways...
2015-09-11 22:34:50 +01:00
Antony Lee
aba7a34036 Fix setting of TIFF ExtraSamples tag.
- force cast ExtraSamples to a list.
- fix calls to ImagingLibTiffSetField to include array length.
2015-09-11 22:26:54 +01:00
Andrew Murray
105e963505 Flake8 fixes 2015-09-11 19:28:19 +10:00
Bogdan Kubala
42b5a85cb4 Fix for UnicodeDecodeError in TiffImagePlugin
Fix for UnicodeDecodeError: ascii codec cannot decode byte while saving a TIFF image

Problem occured while saving TIFF images that contain non-ascii characters in metadata

Manually merged with master by wiredfool
2015-09-10 07:57:47 -07:00
Andrew Murray
95fa2cdf08 Health fix 2015-08-28 18:56:48 +10:00
Andrew Murray
c6b13d294f Flake8 fixes 2015-08-25 22:27:18 +10:00
Andrew Murray
fa73879d19 Changed register calls to use format property 2015-07-04 23:29:58 +10:00
Alex Clark
67d1541c6f Merge pull request #1207 from anntzer/logger
Use logging instead of print.
2015-07-02 05:22:07 -04:00
Andrew Murray
d20eef450b Added is_animated 2015-06-30 13:25:00 +10:00
Antony Lee
4e754e9c55 Use logging instead of print.
cf. #1191.

Only TiffImagePlugin and OLEFileIO still rely on (their own) DEBUG flag.
I left TiffImagePlugin as it is because I hope #1059 gets merged in
first, and OLEFileIO because it uses its own logic.

Untested, as usual.
2015-06-29 12:39:50 -07:00
Andrew Murray
46fad0fd63 Fixed typo 2015-06-28 12:03:11 +10:00
Antony Lee
51f3560dc4 Restore negative seeks for TIFF. 2015-06-08 00:40:23 +10:00
Antony Lee
1b80fe5507 Provide n_frames attribute to multi-frame formats.
cf #1190, #1192.  Tests missing.
2015-06-08 00:40:23 +10:00
Andrew Murray
ed2cca1e71 Fixed Tiff handling of bad EXIF data 2015-06-07 00:09:54 +10:00
Andrew Murray
a996033079 Fixed various typos 2015-05-29 14:59:54 +10:00
Andrew Murray
9794aafc37 Removed or commented unused variables 2015-04-24 16:02:38 +10:00
Andrew Murray
ebc6996ba5 Changed list comprehension variable name to avoid redefinition 2015-04-24 16:00:08 +10:00
Andrew Murray
d1c182cadc Various Flake8 fixes 2015-04-24 09:26:52 +10:00
Björn Pedersen
61fb1c5bd4 Tiff: allow writing floating poitn tag values
Use the inverse logic used for loading floating point tag
values to also write them out again.
2015-02-23 09:46:35 +01:00
Antony Lee
800480db52 Use underscores, not spaces, in TIFF tag kwargs.
kwargs with spaces ("x resolution", "y resolution", "resolution unit"
and "date time") are deprecated.
2014-12-09 15:17:33 -08:00
wiredfool
9a2cc7df83 hoist import, move test to libtiff 2014-11-15 20:38:52 -08:00
Martin Fergie
dd3a46520c Fix for saving to io.BytesIO() 2014-11-14 12:29:10 +00:00
Hugo
4d74b81a15 Merge pull request #980 from wiredfool/pr_938
4 bit TIFF support
2014-10-29 21:41:17 +02:00
hugovk
0df43e4f93 Avoid divide by zero 2014-10-25 23:42:02 +03:00
wiredfool
4f9b2dbe69 Fix pypy 2.4 regression, #952 2014-10-13 11:12:14 -07:00
Hugo
8cb5688047 flake8 2014-10-02 10:45:41 +03:00
Hugo
552a9a28a0 Support and test for 4-bit greyscale TIFF 2014-10-02 10:43:22 +03:00
wiredfool
17ac15543d fp.tell resyncs the python3 with the file pointer 2014-09-02 15:20:25 -07:00
wiredfool
d8b2829f4b Partial fix for test failures, works on py2.x 2014-09-02 15:20:25 -07:00
Kenny Ostrom
d5b4f136c5 added ifd offset to the tiff decoder args, call TIFFSetSubDirectory 2014-09-02 15:20:25 -07:00
wiredfool
99f7dd2aff Allocate a new core image object for each frame, fixes problems with reusing palettes and image sizes 2014-09-02 15:20:25 -07:00
wiredfool
9f04c2d0a5 Don't close fd for multipage files 2014-09-02 15:20:24 -07:00
hugovk
56404f6888 Change wrapping to include some context on first line; plus typo fix 2014-07-29 23:00:38 +03:00
hugovk
70528dd539 flake8 2014-07-28 19:00:06 +03:00
wiredfool
618a79c1c6 Merge from master, pre-unittest conversion 2014-06-03 14:42:22 -07:00
hugovk
c9a4272af6 Replace python-imaging with python-pillow (but yet not Coveralls) 2014-06-03 13:02:44 +03:00
wiredfool
edd75ceb91 Use libtiff for writing any compressed tiff files, Fixes #659, #431 2014-05-20 10:15:01 -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
Hijackal
029a4a5079 Add specific 32-bit float tiff format
We regularly use this format to store 32bit floats and I would like to see it handled by clean Pillow installations without having to add it on every system I use.
2014-04-10 15:52:53 +02:00
wiredfool
937ae7790f Renamed variables from reused single letter confusing names to something halfway descriptive 2014-03-27 22:19:39 -07:00
wiredfool
9552d9bc66 close the fd, if possible. Fixes #526 2014-03-27 22:18:40 -07:00
François Boulogne
923018dfeb MAINT: s/while 1:/while True:/ 2014-01-07 21:21:24 -05:00
wiredfool
aa1c0fdfb6 merge from master 2013-12-19 20:48:49 -08:00