Skip to content

Commit f23dcb1

Browse files
committed
debug
1 parent e573427 commit f23dcb1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

modules/api/api.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,18 @@ def post_invocations(self, b64images, quality):
948948
key = key[ : -1]
949949
images = []
950950
for b64image in b64images:
951-
bytes_data = export_pil_to_bytes(decode_to_image(b64image), quality)
952-
print(f"log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} ***&&& post_invocations")
953-
print(Image.open(BytesIO(bytes_data)).getexif()) # Print the EXIF data
951+
print(f"log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} ***&&& post_invocations_before")
952+
img = decode_to_image(b64image)
953+
print(Image.open(img).getexif()) # Print the EXIF data
954+
955+
if opts.samples_format.lower() in ("jpg", "jpeg", "webp"):
956+
exif_bytes = piexif.dump(set_img_exif_dict())
957+
img.save(img, format="JPEG", exif=exif_bytes, quality=opts.jpeg_quality)
958+
print(f"log@{datetime.datetime.now().strftime(f'%Y%m%d%H%M%S')} ***&&& post_invocations_after")
959+
print(Image.open(img).getexif()) # Print the EXIF data
960+
961+
bytes_data = export_pil_to_bytes(img, quality)
962+
954963
image_id = datetime.datetime.now().strftime(f"%Y%m%d%H%M%S-{uuid.uuid4()}")
955964
suffix = opts.samples_format.lower()
956965
shared.s3_client.put_object(

0 commit comments

Comments
 (0)