From 3c138685ea1b521daa872c5eb3474f8dbc5d8a1e Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 3 May 2017 12:09:18 +0200 Subject: [PATCH] server/images: handle resizing errors --- server/szurubooru/func/images.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/szurubooru/func/images.py b/server/szurubooru/func/images.py index 1a6f9467..16587ed5 100644 --- a/server/szurubooru/func/images.py +++ b/server/szurubooru/func/images.py @@ -50,8 +50,10 @@ class Image: '-ss', '%d' % math.floor(duration * 0.3), ] + cli - self.content = self._execute(cli) - assert self.content + content = self._execute(cli) + if not content: + raise errors.ProcessingError('Error while resizing image.') + self.content = content self._reload_info() def to_png(self) -> bytes: