mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 21:17:02 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
6e49b3d263
commit
c8c708f852
|
@ -30,11 +30,11 @@ with instrument_imports():
|
||||||
def TestOneInput(data):
|
def TestOneInput(data):
|
||||||
if len(data) < 10: # Skip inputs that are too small
|
if len(data) < 10: # Skip inputs that are too small
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create a BytesIO object from the fuzzer data
|
# Create a BytesIO object from the fuzzer data
|
||||||
image_io = io.BytesIO(data)
|
image_io = io.BytesIO(data)
|
||||||
|
|
||||||
# Try to open the image
|
# Try to open the image
|
||||||
with Image.open(image_io) as img:
|
with Image.open(image_io) as img:
|
||||||
# Test EXIF extraction
|
# Test EXIF extraction
|
||||||
|
@ -45,7 +45,7 @@ def TestOneInput(data):
|
||||||
for tag_id, value in exif.items():
|
for tag_id, value in exif.items():
|
||||||
# Try to get the tag name
|
# Try to get the tag name
|
||||||
tag_name = ExifTags.TAGS.get(tag_id, tag_id)
|
tag_name = ExifTags.TAGS.get(tag_id, tag_id)
|
||||||
|
|
||||||
# Try to convert GPS info
|
# Try to convert GPS info
|
||||||
if tag_id == 34853: # GPSInfo tag
|
if tag_id == 34853: # GPSInfo tag
|
||||||
for gps_tag, gps_value in value.items():
|
for gps_tag, gps_value in value.items():
|
||||||
|
@ -53,7 +53,7 @@ def TestOneInput(data):
|
||||||
except Exception:
|
except Exception:
|
||||||
# Catch exceptions from EXIF processing
|
# Catch exceptions from EXIF processing
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Test thumbnail extraction from EXIF
|
# Test thumbnail extraction from EXIF
|
||||||
try:
|
try:
|
||||||
if hasattr(img, 'getexif'):
|
if hasattr(img, 'getexif'):
|
||||||
|
@ -69,7 +69,7 @@ def TestOneInput(data):
|
||||||
except Exception:
|
except Exception:
|
||||||
# Catch exceptions from thumbnail extraction
|
# Catch exceptions from thumbnail extraction
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
# Catch all other exceptions
|
# Catch all other exceptions
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user