mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Merge pull request #1893 from wiredfool/tiff_check
Skip tests that require libtiff if it is not installed, fixes #1866
This commit is contained in:
commit
9a4f6482b4
|
@ -489,6 +489,21 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
im.save(out, format='TIFF')
|
im.save(out, format='TIFF')
|
||||||
TiffImagePlugin.WRITE_LIBTIFF = False
|
TiffImagePlugin.WRITE_LIBTIFF = False
|
||||||
|
|
||||||
|
def test_page_number_x_0(self):
|
||||||
|
# Issue 973
|
||||||
|
# Test TIFF with tag 297 (Page Number) having value of 0 0.
|
||||||
|
# The first number is the current page number.
|
||||||
|
# The second is the total number of pages, zero means not available.
|
||||||
|
outfile = self.tempfile("temp.tif")
|
||||||
|
# Created by printing a page in Chrome to PDF, then:
|
||||||
|
# /usr/bin/gs -q -sDEVICE=tiffg3 -sOutputFile=total-pages-zero.tif
|
||||||
|
# -dNOPAUSE /tmp/test.pdf -c quit
|
||||||
|
infile = "Tests/images/total-pages-zero.tif"
|
||||||
|
im = Image.open(infile)
|
||||||
|
# Should not divide by zero
|
||||||
|
im.save(outfile)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -45,7 +45,11 @@ class Test_IFDRational(PillowTestCase):
|
||||||
self.assertTrue(xres and yres)
|
self.assertTrue(xres and yres)
|
||||||
|
|
||||||
def test_ifd_rational_save(self):
|
def test_ifd_rational_save(self):
|
||||||
for libtiff in (True, False):
|
methods = (True, False)
|
||||||
|
if 'libtiff_encoder' not in dir(Image.core):
|
||||||
|
methods = (False)
|
||||||
|
|
||||||
|
for libtiff in methods:
|
||||||
TiffImagePlugin.WRITE_LIBTIFF = libtiff
|
TiffImagePlugin.WRITE_LIBTIFF = libtiff
|
||||||
|
|
||||||
im = hopper()
|
im = hopper()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user