GPSDateStamp is only a (ASCII-)date with format "YYYY:MM:DD", not a DateTime.
My solution:
Change in ExifPropertyFactory.cs, line 172, ExifDateTime to GPSDateStamp:
else if (tag == 29) // GPSDate
return new GPSDateStamp(ExifTag.GPSDateStamp, ExifBitConverter.ToDateTime(value, false));
Add in ExifExtendedProperty.cs:
public class GPSDateStamp : ExifProperty {
protected DateTime mValue;
protected override object _Value { get { return Value; } set { Value = (DateTime)value; } }
public new DateTime Value { get { return mValue; } set { mValue = value; } }
static public implicit operator DateTime(GPSDateStamp obj) { return obj.mValue; }
public override string ToString() { return mValue.ToString("yyyy:MM:dd"); }
public GPSDateStamp(ExifTag tag, DateTime value)
: base(tag) {
mValue = value;
}
public override ExifInterOperability Interoperability {
get {
return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)11, ExifBitConverter.GetBytes(mValue, false));
}
}
GPSDateStamp is only a (ASCII-)date with format "YYYY:MM:DD", not a DateTime.
My solution:
Change in ExifPropertyFactory.cs, line 172, ExifDateTime to GPSDateStamp: else if (tag == 29) // GPSDate return new GPSDateStamp(ExifTag.GPSDateStamp, ExifBitConverter.ToDateTime(value, false));
Add in ExifExtendedProperty.cs: public class GPSDateStamp : ExifProperty { protected DateTime mValue; protected override object _Value { get { return Value; } set { Value = (DateTime)value; } } public new DateTime Value { get { return mValue; } set { mValue = value; } }
}