| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Yes, with this changes all will be good. However I found another place in Pillow that failing my tests and I think we need to take a look at that: ImageOps.py , exif_transpose: exif_image.info["xmp"] = re.sub(
pattern.encode(), b"", exif_image.info["xmp"]
)I get an KeyError here, as "xmp" can be not present in exif_image.info keys |
Sorry, something went wrong.
|
ImageOps.py , exif_transpose: elif "XML:com.adobe.xmp" in exif_image.info:
for pattern in (
r'tiff:Orientation="([0-9])"',
r"<tiff:Orientation>([0-9])</tiff:Orientation>",
):
exif_image.info["XML:com.adobe.xmp"] = re.sub(
pattern, "", exif_image.info["XML:com.adobe.xmp"]
)
elif "xmp" in exif_image.info:
for pattern in (
r'tiff:Orientation="([0-9])"',
r"<tiff:Orientation>([0-9])</tiff:Orientation>",
):
exif_image.info["xmp"] = re.sub(
pattern.encode(), b"", exif_image.info["xmp"]
)imho, this will be the correct code that not fails with exception when "xmp" not in image.info dictionary |
Sorry, something went wrong.
|
I imagine this is where the failure is occurring? For my own clarity, I wouldn't say that pillow-heif is failing, but rather Pillow is failing to handle an image you've constructed in your tests. But there's no reason that your constructed image isn't perfectly valid, so I've created #8173 By the way, thanks for letting us know about these matters before the release has gone out! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Last year, we received a report of a JPEG image where XMP data was zero-padded at the end. I created a fix for that by adjusting JpegImagePlugin.
Now #8069 (comment) reports that XMP data might also be zero-padded for another format.
So this PR removes zero-byte end padding from XMP data for all formats, not just JPEG.