Commit Graph

47 Commits

Author SHA1 Message Date
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
e44bb42ae9 Replace type() equality checks with isinstance 2016-10-31 06:41:43 -07: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
homm
7a4847f457 all literals are bytes 2016-07-12 22:54:15 +03:00
homm
107307dfc9 do not use as_dict anywhere in tests except tests for as_dict warnings 2016-07-12 21:34:15 +03:00
homm
c2b4ff5fa4 skip empty values in ImageFileDirectory 2016-07-12 18:09:02 +03:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
wiredfool
a64c1674a1 Tests for issue #1462, #1834, #1831, #1910 2016-06-26 12:05:05 +01:00
wiredfool
1e2a27f00d Fixed broken test re: https://github.com/python-pillow/Pillow/issues/1462#issuecomment-210487186 2016-06-26 12:02:45 +01:00
Andrew Murray
677b958a7f Health fixes 2016-04-01 21:49:30 +11:00
wiredfool
3ac9396e8c Write round trip for rationals, including nan value 2015-12-29 22:00:36 +00:00
wiredfool
3dd4b39411 Namespace 2015-12-29 21:33:10 +00:00
wiredfool
5e7a5bf237 Limit rationals for expected values in round trip 2015-12-29 21:33:10 +00:00
wiredfool
8ed2d1ed02 Changing the type of the target values 2015-12-27 20:48:47 +00:00
wiredfool
deecbcd3a3 Added a rational class for TiffIFD that allows for 0/0 2015-12-27 10:21:31 +00:00
Andrew Murray
afa4166a57 Updated deprecated asserts 2015-12-16 14:30:17 +11:00
Andrew Murray
c27110ab56 Flake8 fixes 2015-12-10 21:34:02 +11:00
wiredfool
f8a5ded0d6 Test for #1526, load binary tagged iccprofile 2015-11-15 16:41:49 +00:00
wiredfool
5e670e9b70 using test file with known license 2015-10-03 17:04:40 -07:00
wiredfool
157df44e51 Add tag info for iccprofile, fixes #1462 2015-10-03 16:35:53 +01:00
homm
9930b05a33 fix tiff exif loading in case when file is empty or ended 2015-09-15 04:06:51 +03:00
wiredfool
4596df45c1 Versioned interface for TiffTags 2015-09-13 15:15:13 +01:00
wiredfool
2636679868 updating tests for legacy_api api change 2015-09-13 14:08:49 +01:00
wiredfool
0c35194167 rewrite of #1416 working 2015-09-12 10:11:10 +01:00
wiredfool
b1fdff4034 In a twisty maze of bytes, text and arbitrary metadata, py2 and py3. New IFD is putting textdata in type7 metadata and returning bytes, old one put it in type 2 string and returned a string. This may be an issue 2015-09-11 23:44:23 +01:00
wiredfool
426c9d8fc2 test failing update 2015-09-11 22:40:38 +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
38f7e23495 Include tests of #1113. 2015-09-11 22:35:58 +01:00
Antony Lee
d5b46dce96 Fix MPO support, and Python2.6 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
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
d1c182cadc Various Flake8 fixes 2015-04-24 09:26:52 +10:00
Björn Pedersen
47f5c9e650 Fix float precission 2015-02-23 12:11:20 +01:00
Björn Pedersen
e8553e1dae Tiff float tags: Use first val in tuple 2015-02-23 12:06:29 +01:00
Björn Pedersen
0238a80e24 Fix test failure on float
due to rounding, the values are just 'almost' equal.
2015-02-23 11:19:32 +01:00
Björn Pedersen
1f11fc7be5 Fix typo in test 2015-02-23 11:09:01 +01:00
Björn Pedersen
31be9f12ad Add tests for tiff float tag values
Add tests for writing of float/double values in tiff file tags.
2015-02-23 10:52:27 +01:00
Hugo
c0ce691704 Remove trailing L, not needed for Py2 and errors in Py3 2014-09-23 10:40:03 +03:00
Hugo
5957f5c812 Replace lena_g4.tif with hopper_g4.tif 2014-09-23 10:30:55 +03:00
hugovk
eb458c7c8f Replace lena.tif with hopper.tif (created with ImageMagick) 2014-09-05 12:14:45 +03:00
hugovk
952d1d5bf5 Remove duplicate tag caused by typo in spec: http://www.asmail.be/msg0055321032.html 2014-08-26 15:51:37 +03:00
hugovk
cf04a9a0d2 Remove unused tearDownModule 2014-07-07 20:03:50 +03:00
hugovk
3ec505958e Convert old tests to use unittest 2014-06-10 12:10:47 +03:00
hugovk
c9a4272af6 Replace python-imaging with python-pillow (but yet not Coveralls) 2014-06-03 13:02:44 +03:00
wiredfool
a91283061e Python3 fixes 2013-10-07 23:30:55 -07:00
wiredfool
350cc702f1 Additional tests for reading and writing Tiff ImageFileDirectories 2013-10-07 23:01:15 -07:00
wiredfool
dbf47837ce Add arbitrary tags to tiff images using an ImageFileDirectory 2013-10-02 22:06:17 -07:00