Accept HEIC image format labels
This commit is contained in:
@@ -171,6 +171,28 @@ def test_tiff_and_invalid_color_profile_are_accepted(service):
|
||||
assert image.format == "JPEG"
|
||||
|
||||
|
||||
def test_heic_format_label_is_accepted(service, monkeypatch):
|
||||
_, client, _ = service
|
||||
actual_open = Image.open
|
||||
|
||||
class HeicLabel:
|
||||
def __init__(self, image):
|
||||
self.image = image
|
||||
self.format = "HEIC"
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
self.image.close()
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.image, name)
|
||||
|
||||
monkeypatch.setattr(Image, "open", lambda source: HeicLabel(actual_open(source)))
|
||||
assert upload(client, [photo()]).status_code == 202
|
||||
|
||||
|
||||
def test_photo_date_comes_from_original_metadata(service):
|
||||
_, client, data = service
|
||||
exif = Image.Exif()
|
||||
|
||||
Reference in New Issue
Block a user