Fix processing of images with extreme aspect ratios in html2lrf

This commit is contained in:
Kovid Goyal 2008-03-15 19:09:46 +00:00
parent 00b0cf46fc
commit bce8b75095

View File

@ -902,6 +902,10 @@ class HTMLConverter(object):
factor = 720./self.profile.dpi factor = 720./self.profile.dpi
def scale_image(width, height): def scale_image(width, height):
if width <= 0:
width = 1
if height <= 0:
height = 1
pt = PersistentTemporaryFile(suffix='_html2lrf_scaled_image_.'+encoding.lower()) pt = PersistentTemporaryFile(suffix='_html2lrf_scaled_image_.'+encoding.lower())
self.image_memory.append(pt) # Neccessary, trust me ;-) self.image_memory.append(pt) # Neccessary, trust me ;-)
try: try: