mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 21:24:31 +03:00
Record resolution instead of requiring ctypes
This commit is contained in:
parent
625d7accd6
commit
ca3bc290e3
|
@ -4,7 +4,6 @@ import itertools
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from ctypes import c_float
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -168,14 +167,11 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
val = original[tag]
|
val = original[tag]
|
||||||
if tag.endswith("Resolution"):
|
if tag.endswith("Resolution"):
|
||||||
if legacy_api:
|
if legacy_api:
|
||||||
assert (
|
assert val[0][0] / val[0][1] == (
|
||||||
c_float(val[0][0] / val[0][1]).value
|
4294967295 / 113653537
|
||||||
== c_float(value[0][0] / value[0][1]).value
|
|
||||||
), f"{tag} didn't roundtrip"
|
), f"{tag} didn't roundtrip"
|
||||||
else:
|
else:
|
||||||
assert (
|
assert val == 37.79000115940079, f"{tag} didn't roundtrip"
|
||||||
c_float(val).value == c_float(value).value
|
|
||||||
), f"{tag} didn't roundtrip"
|
|
||||||
else:
|
else:
|
||||||
assert val == value, f"{tag} didn't roundtrip"
|
assert val == value, f"{tag} didn't roundtrip"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user