Commit Graph

143 Commits

Author SHA1 Message Date
Andrew Murray
c2189235af Line too long 2018-07-02 19:26:02 +10:00
Andrew Murray
9a3d554c1d Changed Exception tests to be more specific 2018-06-12 04:41:31 +10:00
Andrew Murray
5ef5a3c9b2 Corrected test 2018-06-06 22:34:09 +10:00
Andrew Murray
b4e6cdadac Added py3 variable to _util 2018-04-20 09:19:13 +10:00
Andrew Murray
c13ccf13a1 Added missing whitespace 2018-03-06 19:53:07 +11:00
Andrew Murray
2202196162 Flake8 blank line fixes 2018-03-04 21:36:33 +11:00
Andrew Murray
30b2ddd070 Removed duplicate imports 2018-01-04 15:40:46 +11:00
Eric Soroos
e617d05b9e These tests/features now require libtiff 2017-12-20 12:22:28 +00:00
Eric Soroos
4877552581 Read all compressed files through libtiff. 2017-12-20 11:55:40 +00:00
Eric Soroos
bec8f415be end to end test helper, more end to end tests for tiffs 2017-12-20 11:55:40 +00:00
Tomasz Jezierski
bc6683cecf tiff-colors-fix test adjust 2017-12-20 11:54:26 +00:00
wiredfool
9ed4ea9e47
Merge pull request #2883 from uploadcare/tiff-wrong-bitspersample
Fix count of BITSPERSAMPLE items in broken TIFF files
2017-12-09 14:32:47 +00:00
Alexander
ce151bcd72 add test for this case 2017-12-08 17:32:39 +03:00
Andrew Murray
bc255c97ff Added support for generators when using append_images 2017-11-04 10:46:15 +11:00
Andrew Murray
f61b70aa8f Changed EOFError tests 2017-09-30 13:33:06 +10:00
Andrew Murray
78c62727d3 Moved seek frame position check into ImageFile 2017-09-30 13:32:43 +10:00
wiredfool
fd8ee8437b Merge pull request #2315 from radarhere/is_animated
If n_frames is known, then use when determining is_animated
2017-09-29 15:26:22 +01:00
Eric Soroos
a89c4e455d Target mode is I, check pixels 2017-09-20 09:26:40 +00:00
Andrew Murray
4087479464 Added test image 2017-09-20 09:04:48 +00:00
Andrew Murray
9e843a2d9b Changed format of lambda calls 2017-09-01 21:05:40 +10:00
Andrew Murray
371933a597 Added tests 2017-09-01 20:36:51 +10:00
Andrew Murray
c10ad19a2b Changed file opening in tests to use with 2017-09-01 20:03:54 +10:00
Alexander
846f986bc8 Tests for 16bit tiff 2017-08-21 17:10:05 +03:00
Andrew Murray
ce999ff302 If n_frames is known, then use when determining is_animated 2017-08-18 20:20:27 +10:00
wiredfool
1f19c023e1 Merge pull request #2406 from blochl/multiframe_tiff
Allow to save tiff stacks from separate images
2017-06-13 22:30:35 +01:00
wiredfool
c3e041e9e6 Merge branch 'master' into rm-deprecated-fn 2017-06-13 13:32:38 +01:00
Andrew Murray
e8cba27bb1 Changed assert checks to more specific versions 2017-06-03 14:04:54 +10:00
hugovk
c70eb8a128 flake8 2017-05-27 23:55:14 +03:00
hugovk
e002207c5b Remove function deprecated and warning since 3.0 (1 Oct 2015) 2017-05-27 21:55:42 +03:00
wiredfool
f95c158933 added non-exclusive fd for test 2017-04-04 00:27:20 -07:00
wiredfool
06b61f4e5b close the mmap when closing the image #2194 2017-04-03 08:06:59 -07:00
wiredfool
86c1704646 add _close_exclusive_fp_after_load flag 2017-04-03 08:06:58 -07:00
wiredfool
900c5e5bf2 added unix test for fd leak 2017-03-14 23:17:22 +00:00
wiredfool
e4e0e0d2bf Adjusted test to match expected behavior 2017-03-14 23:17:22 +00:00
Marcus Brinkmann
e8122600f6 Test for: Close file handle in TiffImagePlugin when image is closed. 2017-03-14 23:17:22 +00:00
Hugo
cb34b686a5 Merge pull request #1822 from radarhere/unused
Remove unused imports
2017-02-26 10:05:19 +02: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
Leonid Bloch
28b818974e Allow to save tiff stacks from separate images
This is a quick solution that will allow to save tiff stacks from
separate images, e.g. from Numpy arrays.
Previously, tiff stacks could be saved only from multiframe images.
This behavior is similar to what is possible now with GIFs.

Note however, that for correct results, all the appended images should
have the same encoder{info,config} properties.

Example:

import numpy as np
from PIL import Image
a = np.ones((100,100,100), dtype=np.uint8)
imlist = []
for m in a:
    imlist.append(Image.fromarray(m))

imlist[0].save("test.tif", compression="tiff_deflate", save_all=True,
               append_images=imlist[1:])

(Should result in a 100-frame, 100x100 tiff stack.)

Signed-off-by: Leonid Bloch <leonid.bloch@esrf.fr>
2017-02-17 00:57:00 +02:00
Marcus Brinkmann
8a9bd2cdcd Default to inch-interpretation for missing ResolutionUnit in TiffImagePlugin. 2017-01-19 17:24:28 +01:00
Andrew Murray
97a2d42dac Removed unused print_function imports 2017-01-18 20:06:21 +11:00
Andrew Murray
41e492b026 Removed use of spaces in TIFF kwargs, deprecated in 2.7 2016-12-09 20:44:42 +11:00
wiredfool
aa247dbb60 Moving tests requiring libtiff to test_file_libtiff 2016-12-05 08:25:10 -08: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
Jon Dufresne
7992d2a65a Fix BytesWarning discovered while running tests
Discovered using the command:

python -b -m nose -vx Tests/test_*.py
2016-10-22 12:35:44 -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
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
Andrew Murray
b58f76dc4f Renamed references to OS X to macOS 2016-09-23 21:12:03 +10: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
Andrew Murray
572a3d970c Removed whitespace from blank lines 2016-09-03 12:23:42 +10:00