Skip to content

Commit

Permalink
Handle empty string as None for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rphlo committed Sep 5, 2024
1 parent 2b825e4 commit d422a7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pillow_jxl/JpegXLImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def _save(im, fp, filename, save_all=False):
if exif and exif.startswith(b"Exif\x00\x00"):
exif = exif[6:]
metadata = {
"exif": exif,
"jumb": info.get("jumb"),
"xmp": info.get("xmp"),
"exif": exif or None,
"jumb": info.get("jumb") or None,
"xmp": info.get("xmp") or None,
}
data = enc(im.tobytes(), im.width, im.height, jpeg_encode=False, **metadata)
fp.write(data)
Expand Down

0 comments on commit d422a7b

Please sign in to comment.