private decimal ReadGPSCoordinates(ExifTagName property) { if (IsPropertyDefined(property)) { byte[] data = GetProperty(property, null); byte[] intnum = new byte[4]; byte[] intdenom = new byte[4]; Array.ConstrainedCopy(data, 0, intnum, 0, 4); Array.ConstrainedCopy(data, 4, intdenom, 0, 4); ExifRational deg = new ExifRational(convertToInt32(intnum), convertToInt32(intdenom)); Array.ConstrainedCopy(data, 8, intnum, 0, 4); Array.ConstrainedCopy(data, 12, intdenom, 0, 4); ExifRational min = new ExifRational(convertToInt32(intnum), convertToInt32(intdenom)); Array.ConstrainedCopy(data, 16, intnum, 0, 4); Array.ConstrainedCopy(data, 20, intdenom, 0, 4); ExifRational sec = new ExifRational(convertToInt32(intnum), convertToInt32(intdenom)); decimal coord = (decimal)(deg.ToInt32() + (decimal)(min.ToFloat() / 60) + (decimal)(sec.ToFloat() / 3600)); return(coord); } else { return(decimal.Zero); } }
public short GetPropertyShort(ExifTagName propertyId, short defaultValue) { return(GetPropertyShort((int)propertyId, defaultValue)); }
public string GetPropertyStringASCII(ExifTagName propertyId, string defaultValue) { return(GetPropertyStringASCII((int)propertyId, defaultValue)); }
public void SetProperty(ExifTagName propertyId, byte[] data, ExifDataType exifType) { SetProperty((int)propertyId, data, exifType); }
// High-level property readers public int GetPropertyInt(ExifTagName propertyId, int defaultValue) { return(GetPropertyInt((int)propertyId, defaultValue)); }
public void SetPropertyShort(ExifTagName propertyId, short value) { SetPropertyShort((int)propertyId, value); }
public void SetPropertyInt(ExifTagName propertyId, int value) { SetPropertyInt((int)propertyId, value); }
public void SetPropertyStringUnicode(ExifTagName propertyId, string value) { SetPropertyStringUnicode((int)propertyId, value); }
public void SetPropertyDateTime(ExifTagName propertyId, DateTime value) { SetPropertyDateTime((int)propertyId, value); }
// High-level property writers public void SetPropertyStringASCII(ExifTagName propertyId, string value) { SetPropertyStringASCII((int)propertyId, value); }
public DateTime GetPropertyDateTime(ExifTagName propertyId, DateTime defaultValue) { return(GetPropertyDateTime((int)propertyId, defaultValue)); }
public ExifRational GetPropertyRational(ExifTagName propertyId) { return(GetPropertyRational((int)propertyId)); }
// Property existence check public bool IsPropertyDefined(ExifTagName propertyId) { return(IsPropertyDefined((int)propertyId)); }
public byte[] GetProperty(ExifTagName propertyId, byte[] defaultValue) { return(GetProperty((int)propertyId, defaultValue)); }