1
0
Fork 0
forked from josch/img2pdf

src/img2pdf.py: reformat with black

This commit is contained in:
Johannes Schauer Marin Rodrigues 2023-10-28 08:35:26 +02:00
parent 5cd0918d50
commit 7f0bf47ff3
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1489,10 +1489,8 @@ def get_imgmetadata(
with io.BytesIO(iccp) as f: with io.BytesIO(iccp) as f:
prf = ImageCms.ImageCmsProfile(f) prf = ImageCms.ImageCmsProfile(f)
if prf.profile.xcolor_space not in ('GRAY'): if prf.profile.xcolor_space not in ("GRAY"):
logger.warning( logger.warning("Ignoring non-GRAY ICC profile in Grayscale JPG")
"Ignoring non-GRAY ICC profile in Grayscale JPG"
)
iccp = None iccp = None
logger.debug("width x height = %dpx x %dpx", imgwidthpx, imgheightpx) logger.debug("width x height = %dpx x %dpx", imgwidthpx, imgheightpx)
@ -4094,17 +4092,20 @@ RGB.""",
% Image.MAX_IMAGE_PIXELS, % Image.MAX_IMAGE_PIXELS,
) )
outargs.add_argument( if sys.platform == "win32":
"--pdfa", pass
nargs="?", else:
const=get_default_icc_profile(), outargs.add_argument(
default=None, "--pdfa",
help="Output a PDF/A-1b compliant document. By default, this will " nargs="?",
"embed either /usr/share/color/icc/sRGB.icc, " const=get_default_icc_profile(),
"/usr/share/color/icc/OpenICC/sRGB.icc or " default=None,
"/usr/share/color/icc/colord/sRGB.icc as the color profile, whichever " help="Output a PDF/A-1b compliant document. By default, this will "
"is found to exist first.", "embed either /usr/share/color/icc/sRGB.icc, "
) "/usr/share/color/icc/OpenICC/sRGB.icc or "
"/usr/share/color/icc/colord/sRGB.icc as the color profile, whichever "
"is found to exist first.",
)
sizeargs = parser.add_argument_group( sizeargs = parser.add_argument_group(
title="Image and page size and layout arguments", title="Image and page size and layout arguments",