|
|
@ -82,7 +82,10 @@ Bugs
|
|
|
|
only nine different values from 1 to 9 are permitted, Anroid phones and
|
|
|
|
only nine different values from 1 to 9 are permitted, Anroid phones and
|
|
|
|
Canon DSLR cameras produce JPEG images with the invalid value of zero.
|
|
|
|
Canon DSLR cameras produce JPEG images with the invalid value of zero.
|
|
|
|
Either fix your input images with `exiftool` or similar software before
|
|
|
|
Either fix your input images with `exiftool` or similar software before
|
|
|
|
passing the JPEG to `img2pdf` or run `img2pdf` with `--rotation=ifvalid`.
|
|
|
|
passing the JPEG to `img2pdf` or run `img2pdf` with `--rotation=ifvalid`
|
|
|
|
|
|
|
|
(if you run img2pdf from the commandline) or by passing
|
|
|
|
|
|
|
|
`rotation=img2pdf.Rotation.ifvalid` as an argument to `convert()` when using
|
|
|
|
|
|
|
|
img2pdf as a library.
|
|
|
|
|
|
|
|
|
|
|
|
- img2pdf uses PIL (or Pillow) to obtain image meta data and to convert the
|
|
|
|
- img2pdf uses PIL (or Pillow) to obtain image meta data and to convert the
|
|
|
|
input if necessary. To prevent decompression bomb denial of service attacks,
|
|
|
|
input if necessary. To prevent decompression bomb denial of service attacks,
|
|
|
@ -191,6 +194,10 @@ The package can also be used as a library:
|
|
|
|
with open("name.pdf","wb") as f:
|
|
|
|
with open("name.pdf","wb") as f:
|
|
|
|
f.write(img2pdf.convert(glob.glob("/path/to/*.jpg")))
|
|
|
|
f.write(img2pdf.convert(glob.glob("/path/to/*.jpg")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ignore invalid rotation values in the input images
|
|
|
|
|
|
|
|
with open("name.pdf","wb") as f:
|
|
|
|
|
|
|
|
f.write(img2pdf.convert('test.jpg'), rotation=img2pdf.Rotation.ifvalid)
|
|
|
|
|
|
|
|
|
|
|
|
# writing to file descriptor
|
|
|
|
# writing to file descriptor
|
|
|
|
with open("name.pdf","wb") as f1, open("test.jpg") as f2:
|
|
|
|
with open("name.pdf","wb") as f1, open("test.jpg") as f2:
|
|
|
|
img2pdf.convert(f2, outputstream=f1)
|
|
|
|
img2pdf.convert(f2, outputstream=f1)
|
|
|
|