Пример #1
0
        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);
            }
        }
Пример #2
0
 public short GetPropertyShort(ExifTagName propertyId, short defaultValue)
 {
     return(GetPropertyShort((int)propertyId, defaultValue));
 }
Пример #3
0
 public string GetPropertyStringASCII(ExifTagName propertyId, string defaultValue)
 {
     return(GetPropertyStringASCII((int)propertyId, defaultValue));
 }
Пример #4
0
 public void SetProperty(ExifTagName propertyId, byte[] data, ExifDataType exifType)
 {
     SetProperty((int)propertyId, data, exifType);
 }
Пример #5
0
        // High-level property readers

        public int GetPropertyInt(ExifTagName propertyId, int defaultValue)
        {
            return(GetPropertyInt((int)propertyId, defaultValue));
        }
Пример #6
0
 public void SetPropertyShort(ExifTagName propertyId, short value)
 {
     SetPropertyShort((int)propertyId, value);
 }
Пример #7
0
 public void SetPropertyInt(ExifTagName propertyId, int value)
 {
     SetPropertyInt((int)propertyId, value);
 }
Пример #8
0
 public void SetPropertyStringUnicode(ExifTagName propertyId, string value)
 {
     SetPropertyStringUnicode((int)propertyId, value);
 }
Пример #9
0
 public void SetPropertyDateTime(ExifTagName propertyId, DateTime value)
 {
     SetPropertyDateTime((int)propertyId, value);
 }
Пример #10
0
        // High-level property writers

        public void SetPropertyStringASCII(ExifTagName propertyId, string value)
        {
            SetPropertyStringASCII((int)propertyId, value);
        }
Пример #11
0
 public DateTime GetPropertyDateTime(ExifTagName propertyId, DateTime defaultValue)
 {
     return(GetPropertyDateTime((int)propertyId, defaultValue));
 }
Пример #12
0
 public ExifRational GetPropertyRational(ExifTagName propertyId)
 {
     return(GetPropertyRational((int)propertyId));
 }
Пример #13
0
        // Property existence check

        public bool IsPropertyDefined(ExifTagName propertyId)
        {
            return(IsPropertyDefined((int)propertyId));
        }
Пример #14
0
 public byte[] GetProperty(ExifTagName propertyId, byte[] defaultValue)
 {
     return(GetProperty((int)propertyId, defaultValue));
 }