예제 #1
0
        void SetMissingMetadata(ExifInterface exif, Location location)
        {
            var exifPos = exif.GetLatLong();

            if (exifPos == null && location != null && location.Latitude != null && location.Longitude != null)
            {
                exif.SetLatLong((double)location.Latitude, (double)location.Longitude);
            }
            if (string.IsNullOrEmpty(exif.GetAttribute(ExifInterface.TagDatetime)))
            {
                exif.SetAttribute(ExifInterface.TagDatetime, DateTime.Now.ToString("yyyy:MM:dd hh:mm:ss"));
                exif.SetAttribute(ExifInterface.TagDatetimeOriginal, DateTime.Now.ToString("yyyy:MM:dd hh:mm:ss"));
            }
            if (string.IsNullOrEmpty(exif.GetAttribute(ExifInterface.TagMake)))
            {
                exif.SetAttribute(ExifInterface.TagMake, Build.Manufacturer);
            }
            if (string.IsNullOrEmpty(exif.GetAttribute(ExifInterface.TagModel)))
            {
                exif.SetAttribute(ExifInterface.TagModel, Build.Model);
            }
        }