oozcitak / exiflibrary

A .Net Standard library for editing Exif metadata
MIT License
131 stars 48 forks source link

Incorrect indexing in ExifVersion.Interoperability causes GPSVersionID to be incorrect #102

Open Timie opened 2 years ago

Timie commented 2 years ago

GPSVersionID would not correctly survive a "roundtrip" JPG -> ExifLibrary.JPGFile -> JPG due to the incorrect indexing of mValue at the following line: https://github.com/oozcitak/exiflibrary/blob/1e0f8381cf9ed1788fd24d9a0ee1b8a7d198abdc/ExifLibrary/ExifExtendedProperty.cs#L216

E.g. GPSVersionID 2.3.0.0 would end up being 2.2.2.2.

The line should rather be as follows (notice the i instead of 0 in the mValue[i]) : data[i] = byte.Parse(mValue[i].ToString());