Skip to content

Commit

Permalink
Uses Autobahn modus by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cmahnke committed Aug 18, 2024
1 parent e4a62be commit 2d2a19c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion scripts/hdr_iiif_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../themes/projektemacher-base/scripts"))

from PyUHDR import get_processors
from PyUHDR import get_processors, init_docker

DEFAULT_LOG_LEVEL = logging.WARN

Expand Down Expand Up @@ -156,6 +156,8 @@ def main(args):
if args.pipeline is not None:
uhdr_options["pipeline"] = args.pipeline

uhdr_options["docker_client"] = init_docker()

print(check_scale_factors(infile, args.tilesize))

if args.check:
Expand Down
9 changes: 7 additions & 2 deletions scripts/manipulator_uhdr_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IIIFManipulatorUHDR(IIIFManipulator):
tmpdir = "/tmp"
filecmd = None
pnmdir = None
uhdr_args = ["contrast", "brightness", "pipeline", "config", "quality"]
uhdr_args = ["contrast", "brightness", "pipeline", "config", "quality", "docker_client"]

def __init__(self, **kwargs):
super_args = {k: v for k, v in kwargs.items() if not k in self.uhdr_args }
Expand Down Expand Up @@ -45,6 +45,11 @@ def __init__(self, **kwargs):
self.config = kwargs["config"]
else:
self.config = None
if "docker_client" in kwargs:
self.docker_client = kwargs["docker_client"]
else:
self.docker_client = None


def set_max_image_pixels(self, pixels):
# Default is alway UHDR max
Expand Down Expand Up @@ -116,7 +121,7 @@ def do_format(self, format):
# self._save(self.outfile)
if self.image is None:
raise ValueError("No image to process!")
uhdr = UHDR(self.image, metadata=self.exif, contrast=self.contrast, brightness=self.brightness, pipeline=self.pipeline, scale=False, config=self.config)
uhdr = UHDR(self.image, metadata=self.exif, contrast=self.contrast, brightness=self.brightness, pipeline=self.pipeline, scale=False, config=self.config, docker_client=self.docker_client)
uhdr.process(self.outfile)

def cleanup(self):
Expand Down

0 comments on commit 2d2a19c

Please sign in to comment.