Commit 4da99681 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

prevent runtime crash when width or height is unavailable

parent a634cf3b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ class File(Resource):
                try:
                    image = Image.open(self.local_path())
                    val, _ = image.size
                except UnidentifiedImageError:
                except (UnidentifiedImageError, FileNotFoundError):
                    logger.warning(
                        f"Could not get width for file({self.pk}) using PIL. Possible image corruption."
                    )
@@ -376,7 +376,7 @@ class File(Resource):
                try:
                    image = Image.open(self.local_path())
                    _, val = image.size
                except UnidentifiedImageError:
                except (UnidentifiedImageError, FileNotFoundError):
                    logger.warning(
                        f"Could not get height for file({self.pk}) using PIL. Possible image corruption."
                    )