mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 13:43:28 +03:00
Removed forcing of BYTE to ASCII
This commit is contained in:
parent
7ecb5aaf7e
commit
859b27572b
|
@ -299,7 +299,11 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if libtiff and isinstance(value, bytes):
|
if (
|
||||||
|
libtiff
|
||||||
|
and isinstance(value, bytes)
|
||||||
|
and isinstance(tiffinfo, dict)
|
||||||
|
):
|
||||||
value = value.decode()
|
value = value.decode()
|
||||||
|
|
||||||
assert reloaded_value == value
|
assert reloaded_value == value
|
||||||
|
@ -322,6 +326,17 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
)
|
)
|
||||||
TiffImagePlugin.WRITE_LIBTIFF = False
|
TiffImagePlugin.WRITE_LIBTIFF = False
|
||||||
|
|
||||||
|
def test_xmlpacket_tag(self, tmp_path):
|
||||||
|
TiffImagePlugin.WRITE_LIBTIFF = True
|
||||||
|
|
||||||
|
out = str(tmp_path / "temp.tif")
|
||||||
|
hopper().save(out, tiffinfo={700: b"xmlpacket tag"})
|
||||||
|
TiffImagePlugin.WRITE_LIBTIFF = False
|
||||||
|
|
||||||
|
with Image.open(out) as reloaded:
|
||||||
|
if 700 in reloaded.tag_v2:
|
||||||
|
assert reloaded.tag_v2[700] == b"xmlpacket tag"
|
||||||
|
|
||||||
def test_int_dpi(self, tmp_path):
|
def test_int_dpi(self, tmp_path):
|
||||||
# issue #1765
|
# issue #1765
|
||||||
im = hopper("RGB")
|
im = hopper("RGB")
|
||||||
|
|
|
@ -761,8 +761,7 @@ PyImaging_LibTiffEncoderNew(PyObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PyBytes_Check(value) &&
|
if (PyBytes_Check(value) && type == TIFF_UNDEFINED) {
|
||||||
(type == TIFF_BYTE || type == TIFF_UNDEFINED)) {
|
|
||||||
// For backwards compatibility
|
// For backwards compatibility
|
||||||
type = TIFF_ASCII;
|
type = TIFF_ASCII;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user