dont offer the define option generally but only offer a toggle for the cropbox

This commit is contained in:
Henning Bunk 2024-01-31 18:56:56 +01:00
parent 213f827e72
commit c2aa796980
No known key found for this signature in database
GPG Key ID: 0E6C529A574BC728

View File

@ -140,7 +140,7 @@ def run_convert(
type=None, type=None,
depth=None, depth=None,
auto_orient=False, auto_orient=False,
define=None, use_cropbox=False,
extra=None, extra=None,
logging_group=None, logging_group=None,
) -> None: ) -> None:
@ -159,7 +159,7 @@ def run_convert(
args += ["-type", str(type)] if type else [] args += ["-type", str(type)] if type else []
args += ["-depth", str(depth)] if depth else [] args += ["-depth", str(depth)] if depth else []
args += ["-auto-orient"] if auto_orient else [] args += ["-auto-orient"] if auto_orient else []
args += ["-define", str(define)] if define else [] args += ["-define", "pdf:use-cropbox=true"] if use_cropbox else []
args += [input_file, output_file] args += [input_file, output_file]
logger.debug("Execute: " + " ".join(args), extra={"group": logging_group}) logger.debug("Execute: " + " ".join(args), extra={"group": logging_group})
@ -231,7 +231,7 @@ def make_thumbnail_from_pdf(in_path, temp_dir, logging_group=None) -> str:
strip=True, strip=True,
trim=False, trim=False,
auto_orient=True, auto_orient=True,
define="pdf:use-cropbox=true", use_cropbox=True,
input_file=f"{in_path}[0]", input_file=f"{in_path}[0]",
output_file=out_path, output_file=out_path,
logging_group=logging_group, logging_group=logging_group,