mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-24 14:14:47 +03:00
Ignore UserWarning for 4 tags: 'Possibly corrupt EXIF data. Expecting to read X bytes but only got Y. Skipping tag Z'
This commit is contained in:
parent
97dae4fd89
commit
cd9f37e813
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from PIL import Image, TiffImagePlugin
|
from PIL import Image, TiffImagePlugin
|
||||||
|
@ -578,6 +579,10 @@ class TestFileTiff(PillowTestCase):
|
||||||
def test_string_dimension(self):
|
def test_string_dimension(self):
|
||||||
# Assert that an error is raised if one of the dimensions is a string
|
# Assert that an error is raised if one of the dimensions is a string
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
|
# Ignore this UserWarning which triggers for four tags:
|
||||||
|
# "Possibly corrupt EXIF data. Expecting to read 50404352 bytes but..."
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", category=UserWarning)
|
||||||
Image.open("Tests/images/string_dimension.tiff")
|
Image.open("Tests/images/string_dimension.tiff")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user