forked from josch/img2pdf
restore backwards compatibility and allow passing images as a list
This commit is contained in:
parent
962d4dbdfb
commit
7c90b2c451
1 changed files with 7 additions and 0 deletions
|
@ -992,6 +992,13 @@ def convert(*images, title=None,
|
||||||
viewer_fit_window, viewer_center_window, viewer_fullscreen,
|
viewer_fit_window, viewer_center_window, viewer_fullscreen,
|
||||||
with_pdfrw)
|
with_pdfrw)
|
||||||
|
|
||||||
|
# backwards compatibility with older img2pdf versions where the first
|
||||||
|
# argument to the function had to be given as a list
|
||||||
|
if len(images) == 1:
|
||||||
|
# if only one argument was given and it is a list, expand it
|
||||||
|
if isinstance(images[0], (list, tuple)):
|
||||||
|
images = images[0]
|
||||||
|
|
||||||
for img in images:
|
for img in images:
|
||||||
# img is allowed to be a path, a binary string representing image data
|
# img is allowed to be a path, a binary string representing image data
|
||||||
# or a file-like object (really anything that implements read())
|
# or a file-like object (really anything that implements read())
|
||||||
|
|
Loading…
Reference in a new issue