drewnoakes / metadata-extractor-dotnet

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Other
936 stars 167 forks source link

Bug in PNG compressed iTXt chunk #421

Open reinfallt opened 5 months ago

reinfallt commented 5 months ago

There seems to be a bug in the decoding of compressed iTXt chunks in PNG files. Instead of trying to decompress the actual compressed data stored after the keyword and flags, the data from the start of the whole chunk is sent instead which causes a failure: https://github.com/drewnoakes/metadata-extractor-dotnet/blob/ed79cc04b915173e1c27318ad90194a3f9caf515/MetadataExtractor/Formats/Png/PngMetadataReader.cs#L267

I have fixed the issue in a branch here and will create a PR: https://github.com/reinfallt/metadata-extractor-dotnet/tree/png_iTXt_compressed

Here is an example png file: red_itxt