Fix #935234 (Resize image can choose zero size for small values)

This commit is contained in:
Kovid Goyal 2012-02-19 00:14:43 +05:30
parent 228a619c18
commit 6e2fb2f1e6

View File

@ -48,6 +48,8 @@ class RescaleImages(object):
scaled, new_width, new_height = fit_image(width, height, scaled, new_width, new_height = fit_image(width, height,
page_width, page_height) page_width, page_height)
if scaled: if scaled:
new_width = max(1, new_width)
new_height = max(1, new_height)
self.log('Rescaling image from %dx%d to %dx%d'%( self.log('Rescaling image from %dx%d to %dx%d'%(
width, height, new_width, new_height), item.href) width, height, new_width, new_height), item.href)
try: try: