mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-24 06:04:46 +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 os
|
||||
import warnings
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image, TiffImagePlugin
|
||||
|
@ -578,6 +579,10 @@ class TestFileTiff(PillowTestCase):
|
|||
def test_string_dimension(self):
|
||||
# Assert that an error is raised if one of the dimensions is a string
|
||||
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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user