From ef76cdaf8ac5818980d44f788f829e574f6e3ee9 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 30 Jul 2016 12:37:39 +0200 Subject: [PATCH] server/posts: always use null size for bad images --- server/szurubooru/func/posts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/szurubooru/func/posts.py b/server/szurubooru/func/posts.py index b39ee11b..68326e25 100644 --- a/server/szurubooru/func/posts.py +++ b/server/szurubooru/func/posts.py @@ -219,6 +219,9 @@ def update_post_content(post, content): except errors.ProcessingError: post.canvas_width = None post.canvas_height = None + if post.canvas_width <= 0 or post.canvas_height <= 0: + post.canvas_width = None + post.canvas_height = None files.save(get_post_content_path(post), content) update_post_thumbnail(post, content=None, delete=False)