mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Merge pull request #5973 from radarhere/planar_configuration
This commit is contained in:
commit
1bc0e1bb9d
|
@ -611,6 +611,17 @@ class TestFileTiff:
|
||||||
with Image.open(infile) as im:
|
with Image.open(infile) as im:
|
||||||
assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
|
assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png")
|
||||||
|
|
||||||
|
def test_planar_configuration_save(self, tmp_path):
|
||||||
|
infile = "Tests/images/tiff_tiled_planar_raw.tif"
|
||||||
|
with Image.open(infile) as im:
|
||||||
|
assert im._planar_configuration == 2
|
||||||
|
|
||||||
|
outfile = str(tmp_path / "temp.tif")
|
||||||
|
im.save(outfile)
|
||||||
|
|
||||||
|
with Image.open(outfile) as reloaded:
|
||||||
|
assert_image_equal_tofile(reloaded, infile)
|
||||||
|
|
||||||
def test_palette(self, tmp_path):
|
def test_palette(self, tmp_path):
|
||||||
def roundtrip(mode):
|
def roundtrip(mode):
|
||||||
outfile = str(tmp_path / "temp.tif")
|
outfile = str(tmp_path / "temp.tif")
|
||||||
|
|
|
@ -1580,7 +1580,7 @@ def _save(im, fp, filename):
|
||||||
libtiff = WRITE_LIBTIFF or compression != "raw"
|
libtiff = WRITE_LIBTIFF or compression != "raw"
|
||||||
|
|
||||||
# required for color libtiff images
|
# required for color libtiff images
|
||||||
ifd[PLANAR_CONFIGURATION] = getattr(im, "_planar_configuration", 1)
|
ifd[PLANAR_CONFIGURATION] = 1
|
||||||
|
|
||||||
ifd[IMAGEWIDTH] = im.size[0]
|
ifd[IMAGEWIDTH] = im.size[0]
|
||||||
ifd[IMAGELENGTH] = im.size[1]
|
ifd[IMAGELENGTH] = im.size[1]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user