Remove producing thumbnail (to be added to stitching repo)
This commit is contained in:
parent
7617d31194
commit
5ca4c824aa
1 changed files with 0 additions and 22 deletions
|
|
@ -770,27 +770,6 @@ class SmartScanThing(Thing):
|
||||||
except SubprocessError as e:
|
except SubprocessError as e:
|
||||||
self._scan_logger.error(f"Stitching failed: {e}", exc_info=e)
|
self._scan_logger.error(f"Stitching failed: {e}", exc_info=e)
|
||||||
|
|
||||||
def update_thumbnail(self):
|
|
||||||
target_size = (400, 400)
|
|
||||||
|
|
||||||
images_folder = self._ongoing_scan_images_dir
|
|
||||||
|
|
||||||
file_path = os.path.join(images_folder, "stitched.jpg")
|
|
||||||
if os.path.isfile(file_path):
|
|
||||||
stitched_image = Image.open(file_path)
|
|
||||||
else:
|
|
||||||
file_path = os.path.join(images_folder, "stitched_from_stage.jpg")
|
|
||||||
if os.path.isfile(file_path):
|
|
||||||
stitched_image = Image.open(file_path)
|
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
|
||||||
stitched_image.thumbnail(target_size)
|
|
||||||
stitched_image.save(os.path.join(images_folder, "stitched_thumbnail.jpg"))
|
|
||||||
except Exception:
|
|
||||||
return None
|
|
||||||
|
|
||||||
@fastapi_endpoint(
|
@fastapi_endpoint(
|
||||||
"get",
|
"get",
|
||||||
"scans/stitched_thumbnail.jpg",
|
"scans/stitched_thumbnail.jpg",
|
||||||
|
|
@ -1101,7 +1080,6 @@ class SmartScanThing(Thing):
|
||||||
self._ongoing_scan_images_dir,
|
self._ongoing_scan_images_dir,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
self.update_thumbnail()
|
|
||||||
|
|
||||||
@_scan_running
|
@_scan_running
|
||||||
def _preview_stitch_running(self) -> bool:
|
def _preview_stitch_running(self) -> bool:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue