Ejemplo n.º 1
0
        public static Exif Read(string path)
        {
            System.Drawing.Image b = null;



            try
            {
                b = new System.Drawing.Bitmap(path);
                Exif result = new Exif();
                foreach (System.Drawing.Imaging.PropertyItem p in b.PropertyItems)
                {
                    object value = ValueOf(p);
                    result[p.Id] = value;
                }
                return(result);
            }
            catch
            {
                return(null);
            }
            finally
            {
                if (b != null)
                {
                    b.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
        private static void Process(string path)
        {
            // EXIF 属性を読み出す
            Exif meta = Exif.Read(path);

            if (meta == null)
            {
                return;
            }

            // DateTimeOriginal
            DateTime?date_taken = Utils.ParseDate(meta[0x9003]);

            if (date_taken == null)
            {
                return;
            }

            Process(path, date_taken.Value);
        }