slurp in the whole file from stdin because we might need to read it multiple times and mupdf needs to seek in it anyways

main
parent 34213ae2a5
commit 2c111d9936
Signed by: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -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…
Cancel
Save