From 0067edf9656b7c1d51360538a25c7f96d0724747 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 14 Aug 2021 10:18:15 +0200 Subject: [PATCH 1/3] remove first_frame_only from gui --- src/img2pdf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 4b8d1c0..45d0988 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -2651,7 +2651,6 @@ def gui(): args = { "engine": tkinter.StringVar(), - "first_frame_only": tkinter.BooleanVar(), "auto_orient": tkinter.BooleanVar(), "fit": tkinter.StringVar(), "title": tkinter.StringVar(), From 5c617965f536c888078212438b8fc0d2cf1924b8 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 14 Aug 2021 10:19:06 +0200 Subject: [PATCH 2/3] document the ifvalid option value further --- src/img2pdf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 45d0988..8d5f2cf 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -3610,8 +3610,9 @@ ifvalid, 0, 90, 180 and 270. The default value is auto and indicates that input images are rotated according to their EXIF Orientation tag. The values none and 0 ignore the EXIF Orientation values of the input images. The value ifvalid acts like auto but ignores invalid EXIF rotation values and only issues a -warning instead of throwing an error. The values 90, 180 and 270 perform a -clockwise rotation of the image. +warning instead of throwing an error. This is useful because many devices like +Android phones, Canon cameras or scanners emit an invalid Orientation tag value +of zero. The values 90, 180 and 270 perform a clockwise rotation of the image. """, ) sizeargs.add_argument( From 55d589a548cd881c3fe5a94a1c7e2db6a88ae8ea Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 14 Aug 2021 10:19:46 +0200 Subject: [PATCH 3/3] README.md: document how to remove alpha channel and --rotation=ifvalid --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10aeedc..3c3e08a 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,17 @@ Bugs - Input images with alpha channels are not allowed. PDF only supports transparency using binary masks but is unable to store 8-bit transparency information as part of the image itself. But img2pdf will always be lossless - and thus, input images must not carry transparency information. + and thus, input images must not carry transparency information. You can + remove the alpha channel for example with imagemagick: + + convert input.png -background white -alpha remove -alpha off output.png + + - An error is produced if the input image is broken. This commonly happens if + the input image has an invalid EXIF Orientation value of zero. Even though + 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. + Either fix your input images with `exiftool` or similar software before + passing the JPEG to `img2pdf` or run `img2pdf` with `--rotation=ifvalid`. - 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,