mirror of https://github.com/zulip/zulip.git
upload: Add test jpg image with no exif data.
This commit is contained in:
parent
a2c9517f8d
commit
cd1233d3f7
|
@ -88,7 +88,7 @@ def exif_rotate(image: Image) -> Image:
|
|||
if not hasattr(image, '_getexif'):
|
||||
return image
|
||||
exif_data = image._getexif()
|
||||
if exif_data is None: # nocoverage # don't have a test image for this case, but it happens
|
||||
if exif_data is None:
|
||||
return image
|
||||
|
||||
exif_dict = dict(exif_data.items())
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -1317,6 +1317,12 @@ class ExifRotateTests(TestCase):
|
|||
result = exif_rotate(img)
|
||||
self.assertEqual(result, img)
|
||||
|
||||
# Image with no exif data.
|
||||
img_data = get_test_image_file('img_no_exif.jpg').read()
|
||||
img = Image.open(io.BytesIO(img_data))
|
||||
result = exif_rotate(img)
|
||||
self.assertEqual(result, img)
|
||||
|
||||
# Orientation of the image is 1.
|
||||
img_data = get_test_image_file('img.jpg').read()
|
||||
img = Image.open(io.BytesIO(img_data))
|
||||
|
|
Loading…
Reference in New Issue