drewnoakes/metadata-extractor-dotnet

UNICODE EXIF UserComment tag read as BigEndian Unicode results in incorrect decoding

Aperta

#423 aperta il 12 giu 2024

 (3 commenti) (0 reazioni) (0 assegnatari)C# (187 fork)github user discovery
format-exifhelp wantedimage-queue

Metriche repository

Star
 (1059 stelle)
Metriche merge PR
 (Merge medio 11h 24m) (1 PR mergiata in 30 g)

Descrizione

338819806-4bc1ebcf-6edb-4545-92e5-ff2fc4f7cfb2

The metadata in the file has a UserComment tag in the Exif SubIFD directory that contains a UNICODE-encoded text containing JSON. With the existing code, the text will be decoded using BigEndianUnicode, which will result in incorrect text.

If the Encoding in TagDescriptor for the UNICODE encodingMap is set to Encoding.Unicode, it will decode properly.

Should this be just Unicode? Is there a discriminator that determines what endianess it should use?

Guida contributor