PDF Output: Fix custom size field not accepting fractional numbers as sizes

This commit is contained in:
Kovid Goyal 2012-12-05 12:23:44 +05:30
parent 40136065f4
commit 7b22c622ed

View File

@ -27,10 +27,10 @@ def get_custom_size(opts):
custom_size = None
if opts.custom_size != None:
width, sep, height = opts.custom_size.partition('x')
if height != '':
if height:
try:
width = int(width)
height = int(height)
width = float(width)
height = float(height)
custom_size = (width, height)
except:
custom_size = None