mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-27 01:00:33 +03:00
Do not detect Ultra HDR images as MPO
This commit is contained in:
parent
e39ee95f56
commit
b15ce5a4bc
BIN
Tests/images/ultrahdr.jpg
Normal file
BIN
Tests/images/ultrahdr.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 509 KiB |
|
@ -226,6 +226,11 @@ def test_eoferror() -> None:
|
||||||
im.seek(n_frames - 1)
|
im.seek(n_frames - 1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_ultra_hdr() -> None:
|
||||||
|
with Image.open("Tests/images/ultrahdr.jpg") as im:
|
||||||
|
assert im.format == "JPEG"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("test_file", test_files)
|
@pytest.mark.parametrize("test_file", test_files)
|
||||||
def test_image_grab(test_file: str) -> None:
|
def test_image_grab(test_file: str) -> None:
|
||||||
with Image.open(test_file) as im:
|
with Image.open(test_file) as im:
|
||||||
|
|
|
@ -843,6 +843,10 @@ def jpeg_factory(fp=None, filename=None):
|
||||||
try:
|
try:
|
||||||
mpheader = im._getmp()
|
mpheader = im._getmp()
|
||||||
if mpheader[45057] > 1:
|
if mpheader[45057] > 1:
|
||||||
|
for segment, content in im.applist:
|
||||||
|
if segment == "APP1" and b' hdrgm:Version="' in content:
|
||||||
|
# Ultra HDR images are not yet supported
|
||||||
|
return im
|
||||||
# It's actually an MPO
|
# It's actually an MPO
|
||||||
from .MpoImagePlugin import MpoImageFile
|
from .MpoImagePlugin import MpoImageFile
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user