Commit Graph

87 Commits

Author SHA1 Message Date
Andrew Murray
0e61d4be9f Removed unused variables 2018-07-02 19:21:44 +10:00
Andrew Murray
dcf6bc047b Do not use bare except 2018-07-02 19:21:44 +10:00
Andrew Murray
b4e6cdadac Added py3 variable to _util 2018-04-20 09:19:13 +10:00
Eric Soroos
768668c1d7 Added RGB*;16N Unpackers 2017-12-20 13:53:14 +00:00
Eric Soroos
e617d05b9e These tests/features now require libtiff 2017-12-20 12:22:28 +00:00
Eric Soroos
4b4f7d6a2c Refactor to use features 2017-12-20 12:21:33 +00:00
Eric Soroos
d698d522ef Added end to end tests in test_file_libtiff 2017-12-20 12:09:26 +00:00
Andrew Murray
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
wiredfool
c16ba722f2 Merge pull request #2551 from jdufresne/keys
Remove unnecessary calls to dict.keys()
2017-06-13 13:12:48 +01:00
Andrew Murray
e8cba27bb1 Changed assert checks to more specific versions 2017-06-03 14:04:54 +10: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
Andrew Murray
37b293f593 Flake8 fixes 2017-04-20 21:14:23 +10:00
Marcus Brinkmann
5bdf1e4998 Test for libtiff, n_frames and seek. 2017-03-14 23:17:22 +00:00
Andrew Murray
1fcdf6a2db Removed duplicate test 2017-03-03 21:38:19 +11:00
Hugo
e83479edf0 Merge pull request #2263 from wiredfool/tiff_bytesio
Fix for writing Tiff to BytesIO using libtiff
2016-12-09 11:04:41 +02:00
wiredfool
aa247dbb60 Moving tests requiring libtiff to test_file_libtiff 2016-12-05 08:25:10 -08: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
ce3432f5f4 Test for issue #2206 2016-11-23 06:24:40 -08: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
Marcus Brinkmann
66de02685f Update info.icc_profile when using libtiff reader. 2016-11-04 16:37:49 +01:00
wiredfool
b81da5a322 Tests for issue #1651 2016-09-29 22:29:19 +01:00
hugovk
2c4a1209f4 flake8 2016-08-04 09:40:12 +03:00
homm
1ba4e9e5ba remove end of file banner from all files 2016-07-10 14:11:28 +03:00
wiredfool
be2100be7b Skip tests that require libtiff if it is not installed, fixes #1866 2016-05-06 09:07:00 -07: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
677b958a7f Health fixes 2016-04-01 21:49:30 +11:00
zwhfly
124bee0485 Add Tests for 2/4 bpp Tiff Grayscale Images
Including inverted and/or bit-order-reversed formats.
2016-03-29 20:19:22 +08:00
wiredfool
e5076a3278 Merge pull request #1620 from wiredfool/issue_1597
Partial fix for #1597
2016-01-01 07:47:58 -08:00
wiredfool
36d4f5a9b4 Tests for permitted libtiff metadata 2016-01-01 05:30:40 -08:00
Andrew Murray
a83bcec169 Flake8 fixes 2015-12-31 07:27:27 +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
b68bb56b64 test for issue #1561 2015-12-14 20:24:01 +00:00
wiredfool
05348d4f8f Reenabling failing/crashing tests, with fixes 2015-09-14 03:03:24 -07:00
wiredfool
c2818ee09e Add versioned api to tests 2015-09-13 16:19:40 +01:00
wiredfool
f3ab9b9f81 temp removing segfaulting test on travis 2015-09-13 14:38:51 +01:00
wiredfool
2636679868 updating tests for legacy_api api change 2015-09-13 14:08:49 +01:00
wiredfool
0c942911d9 fixed the rebase 2015-09-11 22:39:37 +01:00
Antony Lee
c113e8f7cd libtiff's rational precision is limited to C floats. 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
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
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
4e2de9d9ed Added missing future print imports and removed unnecessary imports 2015-05-23 20:28:41 +10:00
Andrew Murray
ee34d6843b Further health fixes 2015-04-24 18:24:52 +10:00
Andrew Murray
7f414057c9 Fixed redefinition of built-in 2015-04-24 16:02:39 +10:00
Andrew Murray
d1c182cadc Various Flake8 fixes 2015-04-24 09:26:52 +10:00
Hugo
02476b7689 Remove unused variable, and other minor flake8 warnings 2014-11-17 10:33:31 +02:00
wiredfool
9a2cc7df83 hoist import, move test to libtiff 2014-11-15 20:38:52 -08:00
wiredfool
2d2474685a Added 4bit test to libtiff as well 2014-10-29 11:07:20 -07:00
Hugo
91aa29ca2b Replace lena with hopper 2014-09-23 16:16:04 +03:00
Hugo
925cea3780 Replace lena_g4.tif with hopper_g4.tif 2014-09-23 10:57:55 +03:00