mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion pipeline: Don't die if rescaling of image raises an exception, just ignore and continue
This commit is contained in:
parent
ceab27ab7a
commit
f5ea7426db
@ -72,10 +72,13 @@ class RescaleImages(object):
|
|||||||
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
|
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
|
||||||
data = pixmap_to_data(img, format=ext)
|
data = pixmap_to_data(img, format=ext)
|
||||||
else:
|
else:
|
||||||
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
|
try:
|
||||||
of = cStringIO.StringIO()
|
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
|
||||||
im.convert('RGB').save(of, ext)
|
of = cStringIO.StringIO()
|
||||||
data = of.getvalue()
|
im.convert('RGB').save(of, ext)
|
||||||
|
data = of.getvalue()
|
||||||
|
except:
|
||||||
|
self.log.exception('Failed to rescale image')
|
||||||
if data is not None:
|
if data is not None:
|
||||||
item.data = data
|
item.data = data
|
||||||
item.unload_data_from_memory()
|
item.unload_data_from_memory()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user