Handle image errors, tweak desc of Update Cover option.

This commit is contained in:
Jim Miller
2012-02-28 13:27:02 -06:00
parent 5a861cafc6
commit d8bf424270
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ class BasicTab(QWidget):
self.l.addWidget(self.updatemeta)
self.updatecover = QCheckBox('Update Cover when Updating Metadata?',self)
self.updatecover.setToolTip('Update cover image when metadata is updated. EPUB only.')
self.updatecover.setToolTip("Update cover image from EPUB when metadata is updated. (EPUB only.)\nDoesn't go looking for new images on 'Update Calibre Metadata Only'.")
self.updatecover.setChecked(prefs['updatecover'])
self.l.addWidget(self.updatecover)
+9 -4
View File
@@ -305,10 +305,15 @@ class Story:
if imgurl not in self.imgurls:
parsedUrl = urlparse.urlparse(imgurl)
sizes = [ int(x) for x in configurable.getConfigList('image_max_size') ]
(data,ext,mime) = convert_image(imgurl,
fetch(imgurl),
sizes,
configurable.getConfig('grayscale_images'))
try:
(data,ext,mime) = convert_image(imgurl,
fetch(imgurl),
sizes,
configurable.getConfig('grayscale_images'))
except Exception, e:
print("Failed to load image, skipping:\n%s\nException: %s"%(imgurl,e))
return "failedtoload"
# explicit cover, make the first image.
if cover:
if len(self.imgtuples) > 0 and 'cover' in self.imgtuples[0]['newsrc']: