示例#1
0
        public Dictionary <string, object> EXIF()
        {
            Dictionary <string, object> Exif;
            long exifOffset;

            if (!offsets.TryGetValue("exifIFD", out exifOffset))
            {
                return(null);
            }

            Exif = extractTags(exifOffset, tags["exif"]);

            // fix formatting of some tags
            object ExifVersion;

            if (Exif.TryGetValue("ExifVersion", out ExifVersion))
            {
                if (ExifVersion is string[])
                {
                    string exifVersion = "";
                    for (int i = 0; i < ((string[])ExifVersion).Length; i++)
                    {
                        exifVersion += (char)Convert.ToInt32(((string[])ExifVersion)[i]);
                    }
                    Exif["ExifVersion"] = exifVersion;
                }
            }

            return(Exif);
        }
示例#2
0
        public Dictionary <string, object> EXIF()
        {
            Dictionary <string, object> Exif;
            long exifOffset;

            if (!offsets.TryGetValue("exifIFD", out exifOffset))
            {
                return(null);
            }

            Exif = extractTags(exifOffset, tags["exif"]);

            // fix formatting of some tags
            object ExifVersion;

            if (Exif.TryGetValue("ExifVersion", out ExifVersion))
            {
                if (ExifVersion is string[])
                {
                    string exifVersion = "";
                    for (int i = 0; i < ((string[])ExifVersion).Length; i++)
                    {
                        exifVersion += (char)Convert.ToInt32(((string[])ExifVersion)[i]);
                    }
                    Exif["ExifVersion"] = exifVersion;
                }
            }

            // store the keys separately (required for JS part to iterate over)
            if (!Exif.ContainsKey("keys"))
            {
                string[] keys = new string[Exif.Keys.Count];
                Exif.Keys.CopyTo(keys, 0);
                Exif.Add("keys", keys);
            }

            return(Exif);
        }