1
0
Fork 0
forked from josch/img2pdf

Allow to call get_layout_fun with less parameters by specifying defaults

This commit is contained in:
Johannes 'josch' Schauer 2017-01-20 09:15:02 +01:00
parent 44ce296581
commit 7df29a9acc

View file

@ -759,7 +759,7 @@ def in_to_pt(length):
return 72*length return 72*length
def get_layout_fun(pagesize, imgsize, border, fit, auto_orient): def get_layout_fun(pagesize=None, imgsize=None, border=None, fit=None, auto_orient=False):
def fitfun(fit, imgwidth, imgheight, fitwidth, fitheight): def fitfun(fit, imgwidth, imgheight, fitwidth, fitheight):
if fitwidth is None and fitheight is None: if fitwidth is None and fitheight is None:
raise ValueError("fitwidth and fitheight cannot both be None") raise ValueError("fitwidth and fitheight cannot both be None")