fix: close library upload flow and harden image storage
This commit is contained in:
@@ -23,7 +23,7 @@ def dimensions(root: Path, path: Path):
|
||||
with os.fdopen(fd, "rb") as stream:
|
||||
if not stat.S_ISREG(os.fstat(stream.fileno()).st_mode):
|
||||
return None
|
||||
with Image.open(stream) as image:
|
||||
with Image.open(stream, formats=("JPEG", "PNG", "WEBP")) as image:
|
||||
width, height = image.size
|
||||
if image.getexif().get(274, 1) in (5, 6, 7, 8):
|
||||
width, height = height, width
|
||||
|
||||
Reference in New Issue
Block a user