Skip to content

Commit

Permalink
Improve thumbnail logic since PDF report now depends on it
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuhlich committed Aug 10, 2023
1 parent e4c95ea commit 185f944
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ashlar/scripts/ashlar.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ def process_single(
ea_args = aligner_args.copy()
for arg in ("alpha", "max_error"):
aligner_args.pop(arg, None)
if len(filepaths) == 1:
# Skip thumbnail unless 2+ cycles or report is enabled.
if len(filepaths) == 1 and report_path is None:
ea_args['do_make_thumbnail'] = False
edge_aligner = reg.EdgeAligner(reader, **ea_args)
edge_aligner.run()
Expand Down Expand Up @@ -291,6 +292,8 @@ def process_single(
mosaics.append(reg.Mosaic(layer_aligner, mshape, **mosaic_args_final))

# Disable reader caching to save memory during mosaicing and writing.
if hasattr(edge_aligner.reader, "thumbnail"):
edge_aligner.reader.reader.thumbnail = edge_aligner.reader.thumbnail
edge_aligner.reader = edge_aligner.reader.reader

if not quiet:
Expand Down

0 comments on commit 185f944

Please sign in to comment.