I have a problem with 'UserComment'. Unfortunately we can have the exif byte order 'big endian' or 'little endian'. The UserComment must read/write with the correct byte order (for Unicode).
2 little changes worked for me:
in ExifPropertyFactory.cs, line 72:
else if (string.Compare(encstr, "Unicode\0", StringComparison.OrdinalIgnoreCase) == 0)
enc = byteOrder == BitConverterEx.ByteOrder.LittleEndian ?
Encoding.Unicode :
Encoding.BigEndianUnicode;
in ExifExtendedProperty.cs, line 106:
else if (mEncoding.EncodingName == "Unicode" ||
mEncoding.EncodingName == "Unicode (Big-Endian)")
enc = "Unicode\0";
In my code i set explicit the value with Encoding:
if (data is ExifLibrary.JPEGFile &&
(data as ExifLibrary.JPEGFile).ByteOrder == BitConverterEx.ByteOrder.BigEndian) {
data.Properties.Set(ExifTag.UserComment, txt, System.Text.Encoding.BigEndianUnicode);
} else
data.Properties.Set(ExifTag.UserComment, txt, System.Text.Encoding.Unicode);
With best regards
I have a problem with 'UserComment'. Unfortunately we can have the exif byte order 'big endian' or 'little endian'. The UserComment must read/write with the correct byte order (for Unicode).
2 little changes worked for me:
in ExifPropertyFactory.cs, line 72:
in ExifExtendedProperty.cs, line 106:
In my code i set explicit the value with Encoding:
With best regards