forked from josch/plakativ
slurp in the whole file from stdin because we might need to read it multiple times and mupdf needs to seek in it anyways
This commit is contained in:
parent
34213ae2a5
commit
2c111d9936
1 changed files with 6 additions and 0 deletions
|
@ -1951,6 +1951,12 @@ def compute_layout(
|
|||
poster_border=False,
|
||||
):
|
||||
doc = None
|
||||
if hasattr(infile, "read"):
|
||||
# we have to slurp in the whole file because we potentially read it
|
||||
# in multiple times in case img2pdf is installed
|
||||
# also, mupdf needs to be able to seek(), so we need to slurp it in
|
||||
# anyways
|
||||
infile = BytesIO(infile.read())
|
||||
if have_img2pdf:
|
||||
# if we have img2pdf available we can encapsulate a raster image
|
||||
# into a PDF container
|
||||
|
|
Loading…
Reference in a new issue