|
|
@ -172,7 +172,6 @@ public class Photo { |
|
|
|
String.Format("{0:D2}", DateTimeOriginal.Day)); |
|
|
|
Directory.CreateDirectory(directory); |
|
|
|
string filename = System.IO.Path.Combine(directory, System.IO.Path.GetFileName(Filename)); |
|
|
|
Console.WriteLine("saving " + filename); |
|
|
|
// FIXME: add comments / captions as ImageDescription?
|
|
|
|
// FIXME: warn if the file already exists?
|
|
|
|
using (Image<Rgba32> image = await Image.LoadAsync<Rgba32>(Filename)) { |
|
|
@ -210,6 +209,7 @@ public class Photo { |
|
|
|
image.Metadata.XmpProfile = UpdateXmp(image.Metadata.XmpProfile); |
|
|
|
|
|
|
|
await image.SaveAsync(filename, encoder); |
|
|
|
Console.WriteLine("saved " + filename); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -347,7 +347,6 @@ public class Photo { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// FIXME: there is also a SubSecTimeOriginal tag we could use to get fractional seconds.
|
|
|
|
// FIXME: I think the iPhone stores time in UTC but other cameras report it in local time.
|
|
|
|
IExifValue<string>? dateTimeOriginal; |
|
|
|
if (exifs.TryGetValue(ExifTag.DateTimeOriginal, out dateTimeOriginal)) { |
|
|
@ -364,6 +363,13 @@ public class Photo { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
IExifValue<string>? subsecTimeOriginal; |
|
|
|
if (exifs.TryGetValue(ExifTag.SubsecTimeOriginal, out subsecTimeOriginal)) { |
|
|
|
double fractionalSeconds; |
|
|
|
Double.TryParse("0." + subsecTimeOriginal.Value, out fractionalSeconds); |
|
|
|
DateTimeOriginal = DateTimeOriginal.AddSeconds(fractionalSeconds); |
|
|
|
} |
|
|
|
|
|
|
|
Gps = GpsInfo.ParseExif(exifs); |
|
|
|
} |
|
|
|
|
|
|
@ -408,7 +414,7 @@ public class Photo { |
|
|
|
} |
|
|
|
|
|
|
|
public string Description() { |
|
|
|
string date = DateTimeOriginal.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
string date = DateTimeOriginal.ToString("yyyy-MM-dd HH:mm:ss.ff"); |
|
|
|
return String.Format( |
|
|
|
"{0,6} {1,-5} {2,-7} {3,-10} {7,4}x{8,-4} {4} {5,-20} {6}", |
|
|
|
FocalLength, FNumber, ExposureTime, IsoSpeed, date, ShortLensModel, Filename, Size.X, Size.Y); |
|
|
|