Capture resolution as a Thing property

This commit is contained in:
jaknapper 2025-05-19 16:49:54 +01:00 committed by Julian Stirling
parent 8c8c6568c3
commit 985d20e032
2 changed files with 17 additions and 6 deletions

View file

@ -291,7 +291,7 @@ class AutofocusThing(Thing):
capture: CaptureDep,
images_dir: str,
stack_dir: str,
target_resolution: tuple[int, int],
capture_resolution: tuple[int, int],
) -> None:
"""Run a z stack, saving all images to stack_dir and copying the
central image to stack_dir"""
@ -322,8 +322,8 @@ class AutofocusThing(Thing):
if capture_count + 1 < images_to_capture:
stage.move_relative(z=stack_dz)
moved = time.time()
if image.size != target_resolution:
image = image.resize(target_resolution, Image.BOX)
if image.size != capture_resolution:
image = image.resize(capture_resolution, Image.BOX)
downsampled = time.time()
capture._save_capture(
jpeg_path=jpeg_path,