From 6bff0a6a2658d3b065cdbaadec774853c098a108 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 10 Apr 2016 17:04:25 +0200 Subject: [PATCH] server/images: fix processing errors --- server/szurubooru/app.py | 2 +- server/szurubooru/util/images.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/szurubooru/app.py b/server/szurubooru/app.py index bd870ac..da00d7f 100644 --- a/server/szurubooru/app.py +++ b/server/szurubooru/app.py @@ -40,7 +40,7 @@ def _on_not_found_error(ex, _request, _response, _params): raise falcon.HTTPNotFound(title='Not found', description=str(ex)) def _on_processing_error(ex, _request, _response, _params): - raise falcon.HTTPNotFound(title='Processing error', description=str(ex)) + raise falcon.HTTPBadRequest(title='Processing error', description=str(ex)) def create_app(): ''' Create a WSGI compatible App object. ''' diff --git a/server/szurubooru/util/images.py b/server/szurubooru/util/images.py index 17b2a74..e94d675 100644 --- a/server/szurubooru/util/images.py +++ b/server/szurubooru/util/images.py @@ -38,11 +38,12 @@ class Image(object): def _execute(self, cli): proc = subprocess.Popen( - ['ffmpeg'] + cli, + ['ffmpeg', '-loglevel', '24'] + cli, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate(input=self.content) if proc.returncode != 0: - raise errors.ConversionError(err) + raise errors.ProcessingError( + 'Error while processing image.\n' + err.decode('utf-8')) return out