aboutsummaryrefslogtreecommitdiff
path: root/cgi/img.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/img.py')
-rw-r--r--cgi/img.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cgi/img.py b/cgi/img.py
index 73bbdc7..ff7cd74 100644
--- a/cgi/img.py
+++ b/cgi/img.py
@@ -4,6 +4,7 @@ import math
#import random
import os
import subprocess
+import logging
from StringIO import StringIO
from settings import Settings
@@ -92,7 +93,7 @@ def processImage(post, data, t, originalname, spoiler=False):
if used_filetype['ffmpeg_thumb'] == '1':
# use ffmpeg to make thumbnail
- logTime("Generating thumbnail")
+ logging.debug("Generating thumbnail")
if used_filetype['mime'][:5] == 'video':
# Create preview for video AND spoiler it if necessary
@@ -112,6 +113,7 @@ def processImage(post, data, t, originalname, spoiler=False):
"-quality", str(Settings.THUMB_QUALITY), file_thumb_path])
except subprocess.CalledProcessError, e:
os.remove(file_path)
+ logging.error("Thumbnail creation failure: " + e.output)
raise UserError, _("Thumbnail creation failure.") + ' ('+str(e.returncode)+')'
elif used_filetype['mime'][:5] == 'audio':
# we do an exception and use png for audio waveform thumbnails since they
@@ -135,6 +137,7 @@ def processImage(post, data, t, originalname, spoiler=False):
'-frames:v', '1', '-threads', '1', file_thumb_path])
except subprocess.CalledProcessError, e:
os.remove(file_path)
+ logging.error("Thumbnail creation failure: " + e.output)
raise UserError, _("Thumbnail creation failure.") + ' ('+str(e.returncode)+')'
else:
# use imagemagick to make thumbnail
@@ -146,11 +149,12 @@ def processImage(post, data, t, originalname, spoiler=False):
args += ["-quality", str(Settings.THUMB_QUALITY), file_thumb_path]
# generate thumbnails
- logTime("Generating thumbnail")
+ logging.debug("Generating thumbnail")
try:
subprocess.check_output(args)
except subprocess.CalledProcessError, e:
os.remove(file_path)
+ logging.error("Thumbnail creation failure: " + repr(e.output))
raise UserError, _("Thumbnail creation failure.") + ' ('+str(e.returncode)+')'
# check if thumbnail was truly created