# HG changeset patch # User neko259 # Date 2017-04-17 08:41:09 # Node ID 0e271eaeef0d2e0b461de9b0c46e848ab409a8e0 # Parent c3c10de6fe6484549dc571efc84c2497777ff283 Fixed viewing an image without a preview diff --git a/boards/models/attachment/viewers.py b/boards/models/attachment/viewers.py --- a/boards/models/attachment/viewers.py +++ b/boards/models/attachment/viewers.py @@ -182,7 +182,10 @@ class ImageViewer(AbstractViewer): return super().get_format_view() preview_path = self.file.path.replace('.', '.200x150.') - pre_width, pre_height = get_image_dimensions(preview_path) + try: + pre_width, pre_height = get_image_dimensions(preview_path) + except Exception: + return super().get_format_view() split = self.file.url.rsplit('.', 1) w, h = 200, 150