Skip to content

Commit

Permalink
PNG Info: Record metadata to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Jul 13, 2023
1 parent 8fe35b6 commit b022d4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discord_tron_master/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def upload_image():
logging.error(f"Could not open image: {e}")
return jsonify({"error": "Malformed image was supplied", "error_class": "UnidentifiedImageError"}), 400
buffered = BytesIO()
img.save(buffered, format="PNG")
img.save(buffered, format="PNG", pnginfo=pnginfo)
base64_encoded_image = base64.b64encode(buffered.getvalue()).decode('utf-8')
image_url = asyncio.run(DiscordCommandProcessor.get_image_embed(base64_encoded_image, pnginfo, create_embed=False))
return jsonify({"image_url": image_url.strip()})
Expand Down

0 comments on commit b022d4b

Please sign in to comment.