예제 #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));
 }