diff --git a/app/Services/upload_service.py b/app/Services/upload_service.py index 747b91a..6a83bfe 100644 --- a/app/Services/upload_service.py +++ b/app/Services/upload_service.py @@ -68,7 +68,7 @@ async def _upload_task(self, img_data: ImageData, img_bytes: bytes, skip_ocr: bo logger.info("Start generate and upload thumbnail for {}.", img_data.id) img.thumbnail((256, 256), resample=Image.Resampling.LANCZOS) img_byte_arr = BytesIO() - img.save(img_byte_arr, 'WebP') + img.save(img_byte_arr, 'WebP', save_all=True) await self._storage_service.active_storage.upload(img_byte_arr.getvalue(), thumb_path) logger.success("Thumbnail for {} generated and uploaded!", img_data.id) diff --git a/scripts/local_create_thumbnail.py b/scripts/local_create_thumbnail.py index 0da0f7e..5ad6910 100644 --- a/scripts/local_create_thumbnail.py +++ b/scripts/local_create_thumbnail.py @@ -43,7 +43,7 @@ async def main(): # generate thumbnail max size 256*256 img.thumbnail((256, 256)) img_byte_arr = io.BytesIO() - img.save(img_byte_arr, 'WebP') + img.save(img_byte_arr, 'WebP', save_all=True) await services.storage_service.active_storage.upload(img_byte_arr.getvalue(), f'thumbnails/{str(image_id)}.webp') logger.success("Thumbnail for {} generated!", image_id)