Rename central image to sharpest

This commit is contained in:
jaknapper 2025-06-23 18:13:46 +01:00
parent 7c3a9ad01f
commit 11c8f47e20

View file

@ -353,8 +353,8 @@ class AutofocusThing(Thing):
image to images dir."""
image_list = glob.glob(os.path.join(stack_dir, "*"))
image_list = sorted(image_list, key=os.path.getsize)
central_image = image_list[-1]
sharpest_image = image_list[-1]
xy_location = os.path.basename(stack_dir)
logger.info(central_image)
shutil.copy(central_image, os.path.join(images_dir, f"{xy_location}.jpeg"))
logger.info(sharpest_image)
shutil.copy(sharpest_image, os.path.join(images_dir, f"{xy_location}.jpeg"))