FF-1257 - added extra exif to read the date an image was taken

This commit is contained in:
John Andrews
2024-02-03 10:56:01 +13:00
parent 8431cb7a8f
commit a83491e2ce
3 changed files with 3 additions and 8 deletions

View File

@@ -142,11 +142,7 @@ public abstract class ImageBaseNode:Node
if (dateTaken != null)
{
variables.AddOrUpdate("img.DateTaken.Value", dateTaken.Value);
variables.AddOrUpdate("img.DateTaken.Year", dateTaken.Value.Year);
variables.AddOrUpdate("img.DateTaken.Month", dateTaken.Value.Month);
variables.AddOrUpdate("img.DateTaken.Day", dateTaken.Value.Day);
variables.AddOrUpdate("img.DateTaken.FulLDate", dateTaken.Value.ToString("yyyy-MM-dd"));
variables.AddOrUpdate("img.DateTaken", dateTaken.Value);
}
var metadata = new Dictionary<string, object>();

View File

@@ -24,8 +24,7 @@ public class ImageFile : ImageBaseNode
{ "img.DateTaken.Year", 2020 },
{ "img.DateTaken.Month", 4 },
{ "img.DateTaken.Day", 20 },
{ "img.DateTaken.FulLDate", "2020-04-20" }
{ "img.DateTaken.Day", 20 }
};
}

View File

@@ -306,7 +306,7 @@ public class ImageNodesTests
var node = new ImageFile();
var result = node.Execute(args);
Assert.AreEqual(1, result);
if(node.Variables.TryGetValue("img.DateTaken.Value", out object oDate) == false)
if(node.Variables.TryGetValue("img.DateTaken", out object oDate) == false)
Assert.Fail("Failed to get date time");
if(oDate is DateTime dt == false)