mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Skip tests that require libtiff if it is not installed, fixes #1866
This commit is contained in:
parent
8a061218ee
commit
be2100be7b
|
@ -489,6 +489,21 @@ class TestFileLibTiff(LibTiffTestCase):
|
|||
im.save(out, format='TIFF')
|
||||
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__':
|
||||
unittest.main()
|
||||
|
|
|
@ -45,7 +45,11 @@ class Test_IFDRational(PillowTestCase):
|
|||
self.assertTrue(xres and yres)
|
||||
|
||||
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
|
||||
|
||||
im = hopper()
|
||||
|
|
Loading…
Reference in New Issue
Block a user