Compare commits
2 Commits
iso-30d8a2
...
07-15-a
Author | SHA1 | Date | |
---|---|---|---|
357cd8c902 | |||
1ede3ebcdb |
@ -82,17 +82,38 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
"PopulatePropertyId": true,
|
"PopulatePropertyId": true,
|
||||||
"PropertiesChangedForProperty": false,
|
"PropertiesChangedForProperty": false,
|
||||||
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
|
".nef",
|
||||||
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"PropertyContentCollectionFiles": [
|
"PropertyContentCollectionFiles": [
|
||||||
"/Images-ec5a909 - Results/A) Property/2022-12-30/[()]/637869381676042455.json",
|
"/Images-ec5a909 - Results/A) Property/2022-12-30/[()]/637869381676042455.json",
|
||||||
@ -117,7 +138,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
],
|
],
|
||||||
"VerifyToSeason": [
|
"VerifyToSeason": [
|
||||||
". 2000",
|
". 2000",
|
||||||
|
@ -53,7 +53,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
"PopulatePropertyId": true,
|
"PopulatePropertyId": true,
|
||||||
@ -90,12 +89,32 @@
|
|||||||
"/zzz Phares Slides/Slides 2015-06-10/Magazine 01"
|
"/zzz Phares Slides/Slides 2015-06-10/Magazine 01"
|
||||||
],
|
],
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"PropertyContentCollectionFiles": [
|
"PropertyContentCollectionFiles": [
|
||||||
"/Images-ec5a909 - Results/A) Property/2022-12-30/[()]/637869381676042455.json",
|
"/Images-ec5a909 - Results/A) Property/2022-12-30/[()]/637869381676042455.json",
|
||||||
@ -120,7 +139,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
],
|
],
|
||||||
"VerifyToSeason": [
|
"VerifyToSeason": [
|
||||||
". 2000",
|
". 2000",
|
||||||
|
@ -134,7 +134,7 @@ internal abstract class Container
|
|||||||
int maxDegreeOfParallelism = Environment.ProcessorCount;
|
int maxDegreeOfParallelism = Environment.ProcessorCount;
|
||||||
int filesCollectionDirectoryLength = filesCollectionDirectory.Length;
|
int filesCollectionDirectoryLength = filesCollectionDirectory.Length;
|
||||||
ParallelOptions parallelOptions = new() { MaxDegreeOfParallelism = maxDegreeOfParallelism };
|
ParallelOptions parallelOptions = new() { MaxDegreeOfParallelism = maxDegreeOfParallelism };
|
||||||
(_, string bResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories();
|
string bResultsFullGroupDirectory = dlibDotNet.GetResultsFullGroupDirectories();
|
||||||
string jsonGroupDirectory = Path.Combine(bResultsFullGroupDirectory, propertyConfiguration.ResultSingleton);
|
string jsonGroupDirectory = Path.Combine(bResultsFullGroupDirectory, propertyConfiguration.ResultSingleton);
|
||||||
if (!Directory.Exists(jsonGroupDirectory))
|
if (!Directory.Exists(jsonGroupDirectory))
|
||||||
_ = Directory.CreateDirectory(jsonGroupDirectory);
|
_ = Directory.CreateDirectory(jsonGroupDirectory);
|
||||||
@ -226,8 +226,8 @@ internal abstract class Container
|
|||||||
if (filePaths is not null && change is not null)
|
if (filePaths is not null && change is not null)
|
||||||
RenameFile(filePair, filePair.FilePath, change.Value, filePaths);
|
RenameFile(filePair, filePair.FilePath, change.Value, filePaths);
|
||||||
}
|
}
|
||||||
|
lastWriteTimeChanged = exifDirectory?.FilePath is not null ? exifDirectory.FilePath.LastWriteTicks != filePair.FilePath.LastWriteTicks : null;
|
||||||
relativePath = Shared.Models.Stateless.Methods.IPath.GetRelativePath(filePair.FilePath.FullName, rootDirectoryLength, forceExtensionToLower: true);
|
relativePath = Shared.Models.Stateless.Methods.IPath.GetRelativePath(filePair.FilePath.FullName, rootDirectoryLength, forceExtensionToLower: true);
|
||||||
lastWriteTimeChanged = exifDirectory?.FilePath is not null ? propertyConfiguration.PropertiesChangedForProperty || exifDirectory.FilePath.LastWriteTicks != filePair.FilePath.LastWriteTicks : null;
|
|
||||||
if (filePair.Match is not null)
|
if (filePair.Match is not null)
|
||||||
sourceDirectoryFileHolder = IFileHolder.Get(filePair.Match);
|
sourceDirectoryFileHolder = IFileHolder.Get(filePair.Match);
|
||||||
else if (!filePair.IsUnique)
|
else if (!filePair.IsUnique)
|
||||||
@ -381,7 +381,7 @@ internal abstract class Container
|
|||||||
private static void AnyMoved(IDlibDotNet dlibDotNet, IPropertyConfiguration propertyConfiguration, string facesFileNameExtension, string facesHiddenFileNameExtension, string eDistanceContentDirectory, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, ReadOnlyDictionary<int, ReadOnlyCollection<FilePath>> idToFilePaths, string directorySearchFilter)
|
private static void AnyMoved(IDlibDotNet dlibDotNet, IPropertyConfiguration propertyConfiguration, string facesFileNameExtension, string facesHiddenFileNameExtension, string eDistanceContentDirectory, ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection, ReadOnlyDictionary<int, ReadOnlyCollection<FilePath>> idToFilePaths, string directorySearchFilter)
|
||||||
{
|
{
|
||||||
const string extension = ".json";
|
const string extension = ".json";
|
||||||
(_, string bResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories();
|
string bResultsFullGroupDirectory = dlibDotNet.GetResultsFullGroupDirectories();
|
||||||
string bMetaSingletonDirectory = Path.Combine(bResultsFullGroupDirectory, propertyConfiguration.ResultSingleton);
|
string bMetaSingletonDirectory = Path.Combine(bResultsFullGroupDirectory, propertyConfiguration.ResultSingleton);
|
||||||
if (!Directory.Exists(bMetaSingletonDirectory))
|
if (!Directory.Exists(bMetaSingletonDirectory))
|
||||||
_ = Directory.CreateDirectory(bMetaSingletonDirectory);
|
_ = Directory.CreateDirectory(bMetaSingletonDirectory);
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -71,12 +70,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "D:/Images",
|
"RootDirectory": "D:/Images",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -92,7 +111,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class DateGroup
|
|||||||
if (!_IsEnvironment.Development)
|
if (!_IsEnvironment.Development)
|
||||||
throw new Exception("This program only allows development environments!");
|
throw new Exception("This program only allows development environments!");
|
||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
Metadata.Models.B_Metadata metadata = new(propertyConfiguration);
|
Metadata.Models.A_Metadata metadata = new(propertyConfiguration);
|
||||||
string[] dbFiles = Directory.GetFiles(propertyConfiguration.RootDirectory, "*.db", SearchOption.AllDirectories);
|
string[] dbFiles = Directory.GetFiles(propertyConfiguration.RootDirectory, "*.db", SearchOption.AllDirectories);
|
||||||
foreach (string dbFile in dbFiles)
|
foreach (string dbFile in dbFiles)
|
||||||
File.Delete(dbFile);
|
File.Delete(dbFile);
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
"ByWeek": false,
|
"ByWeek": false,
|
||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"KeepFullPath": false,
|
"KeepFullPath": false,
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -70,12 +69,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "C:/Tmp/phares/Pictures",
|
"RootDirectory": "C:/Tmp/phares/Pictures",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"PropertyContentCollectionFiles": [],
|
"PropertyContentCollectionFiles": [],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
@ -92,7 +111,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
],
|
],
|
||||||
"VerifyToSeason": [
|
"VerifyToSeason": [
|
||||||
". 2000",
|
". 2000",
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -72,12 +71,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -93,7 +112,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -67,12 +66,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -88,7 +107,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -68,12 +67,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
"RootDirectory": "C:/Tmp/Phares/Compare/Images-dd514b88",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -89,7 +108,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ using System.Text.Json.Serialization;
|
|||||||
using View_by_Distance.FaceRecognitionDotNet;
|
using View_by_Distance.FaceRecognitionDotNet;
|
||||||
using View_by_Distance.Metadata.Models;
|
using View_by_Distance.Metadata.Models;
|
||||||
using View_by_Distance.Metadata.Models.Stateless.Methods;
|
using View_by_Distance.Metadata.Models.Stateless.Methods;
|
||||||
using View_by_Distance.Property.Models;
|
|
||||||
using View_by_Distance.Resize.Models;
|
using View_by_Distance.Resize.Models;
|
||||||
using View_by_Distance.Shared.Models;
|
using View_by_Distance.Shared.Models;
|
||||||
using View_by_Distance.Shared.Models.Properties;
|
using View_by_Distance.Shared.Models.Properties;
|
||||||
@ -190,7 +189,7 @@ public class D_Face : IFaceD
|
|||||||
FileHolder fileHolder;
|
FileHolder fileHolder;
|
||||||
string deterministicHashCodeKey;
|
string deterministicHashCodeKey;
|
||||||
string fileName = mappingFromItem.FilePath.NameWithoutExtension;
|
string fileName = mappingFromItem.FilePath.NameWithoutExtension;
|
||||||
string[] changesFrom = [nameof(A_Property), nameof(B_Metadata), nameof(C_Resize)];
|
string[] changesFrom = [nameof(A_Metadata), nameof(C_Resize)];
|
||||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||||
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
||||||
string directory = _ResultContentFileGroups[0][cei.Enum][cei.Index];
|
string directory = _ResultContentFileGroups[0][cei.Enum][cei.Index];
|
||||||
@ -269,7 +268,7 @@ public class D_Face : IFaceD
|
|||||||
List<Shared.Models.Face>? results;
|
List<Shared.Models.Face>? results;
|
||||||
string? json;
|
string? json;
|
||||||
List<Location> locations;
|
List<Location> locations;
|
||||||
string[] changesFrom = [nameof(A_Property), nameof(B_Metadata), nameof(C_Resize)];
|
string[] changesFrom = [nameof(A_Metadata), nameof(C_Resize)];
|
||||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||||
string fileName = $"{mappingFromItem.FilePath.NameWithoutExtension}{mappingFromItem.FilePath.ExtensionLowered}.json";
|
string fileName = $"{mappingFromItem.FilePath.NameWithoutExtension}{mappingFromItem.FilePath.ExtensionLowered}.json";
|
||||||
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
||||||
@ -475,7 +474,7 @@ public class D_Face : IFaceD
|
|||||||
dFace.ReSaveFace(exifDirectory, filePath, face, mappedFile: false);
|
dFace.ReSaveFace(exifDirectory, filePath, face, mappedFile: false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
location = Shared.Models.Stateless.Methods.ILocation.GetLocation(face.Location, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, source.Height, source.Width, collection.Count);
|
location = Shared.Models.Stateless.Methods.ILocation.GetLocation(face.Location, source.Height, source.Width, collection.Count);
|
||||||
if (location is null)
|
if (location is null)
|
||||||
continue;
|
continue;
|
||||||
width = location.Right - location.Left;
|
width = location.Right - location.Left;
|
||||||
@ -506,7 +505,7 @@ public class D_Face : IFaceD
|
|||||||
}
|
}
|
||||||
if (File.Exists(fileName))
|
if (File.Exists(fileName))
|
||||||
File.Delete(fileName);
|
File.Delete(fileName);
|
||||||
location = Shared.Models.Stateless.Methods.ILocation.GetLocation(_FaceDistanceHiddenImageFactor, face.Location, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, source.Height, source.Width, collection.Count);
|
location = Shared.Models.Stateless.Methods.ILocation.GetLocation(_FaceDistanceHiddenImageFactor, face.Location, source.Height, source.Width, collection.Count);
|
||||||
if (location is null)
|
if (location is null)
|
||||||
continue;
|
continue;
|
||||||
width = location.Right - location.Left;
|
width = location.Right - location.Left;
|
||||||
|
@ -214,7 +214,7 @@ public class D2_FaceParts
|
|||||||
bool updateDateWhenMatches = false;
|
bool updateDateWhenMatches = false;
|
||||||
List<(Shared.Models.Face, string, string)> collection = [];
|
List<(Shared.Models.Face, string, string)> collection = [];
|
||||||
string fileName = mappingFromItem.FilePath.NameWithoutExtension;
|
string fileName = mappingFromItem.FilePath.NameWithoutExtension;
|
||||||
string[] changesFrom = [nameof(A_Property), nameof(B_Metadata), nameof(C_Resize), nameof(D_Face)];
|
string[] changesFrom = [nameof(A_Metadata), nameof(C_Resize), nameof(D_Face)];
|
||||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||||
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
||||||
string directory = _ResultContentFileGroups[0][cei.Enum][cei.Index];
|
string directory = _ResultContentFileGroups[0][cei.Enum][cei.Index];
|
||||||
|
@ -31,6 +31,8 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
ReadOnlyCollection<ReadOnlyCollection<FilePath>> FilePathsCollection,
|
ReadOnlyCollection<ReadOnlyCollection<FilePath>> FilePathsCollection,
|
||||||
ReadOnlyDictionary<int, Identifier>? SplatNineIdentifiers);
|
ReadOnlyDictionary<int, Identifier>? SplatNineIdentifiers);
|
||||||
|
|
||||||
|
public int? CurrentTick =>
|
||||||
|
_ProgressBar?.CurrentTick;
|
||||||
public long Ticks { get; init; }
|
public long Ticks { get; init; }
|
||||||
|
|
||||||
private readonly D_Face _Faces;
|
private readonly D_Face _Faces;
|
||||||
@ -87,7 +89,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
if (configuration.IgnoreExtensions is null)
|
if (configuration.IgnoreExtensions is null)
|
||||||
throw new NullReferenceException(nameof(configuration.IgnoreExtensions));
|
throw new NullReferenceException(nameof(configuration.IgnoreExtensions));
|
||||||
_BlurHasher = new BlurHash.Models.C2_BlurHasher(configuration.PropertyConfiguration);
|
_BlurHasher = new BlurHash.Models.C2_BlurHasher(configuration.PropertyConfiguration);
|
||||||
string propertyRoot = Property.Models.Stateless.IResult.GetResultsGroupDirectory(propertyConfiguration, nameof(A_Property), create: false);
|
string propertyRoot = Property.Models.Stateless.IResult.GetResultsGroupDirectory(propertyConfiguration, nameof(A_Metadata), create: false);
|
||||||
_PropertyRootExistedBefore = !Directory.Exists(propertyRoot);
|
_PropertyRootExistedBefore = !Directory.Exists(propertyRoot);
|
||||||
string argZero = args.Count > 0 ? Path.GetFullPath(args[0]) : Path.GetFullPath(propertyConfiguration.RootDirectory);
|
string argZero = args.Count > 0 ? Path.GetFullPath(args[0]) : Path.GetFullPath(propertyConfiguration.RootDirectory);
|
||||||
_ArgZeroIsConfigurationRootDirectory = propertyConfiguration.RootDirectory == argZero;
|
_ArgZeroIsConfigurationRootDirectory = propertyConfiguration.RootDirectory == argZero;
|
||||||
@ -175,7 +177,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
_Logger?.LogInformation("First run completed. Run again if wanted");
|
_Logger?.LogInformation("First run completed. Run again if wanted");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int FullParallelForWork(B_Metadata metadata,
|
private int FullParallelForWork(A_Metadata metadata,
|
||||||
MapLogic mapLogic,
|
MapLogic mapLogic,
|
||||||
string outputResolution,
|
string outputResolution,
|
||||||
bool outputResolutionHasNumber,
|
bool outputResolutionHasNumber,
|
||||||
@ -195,18 +197,13 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
DateTime dateTime = DateTime.Now;
|
DateTime dateTime = DateTime.Now;
|
||||||
List<string> parseExceptions = [];
|
List<string> parseExceptions = [];
|
||||||
string[] changesFrom = [nameof(A_Property)];
|
string[] changesFrom = [nameof(A_Metadata)];
|
||||||
List<Tuple<string, DateTime>> subFileTuples = [];
|
List<Tuple<string, DateTime>> subFileTuples = [];
|
||||||
FileHolder resizedFileHolder = _Resize.GetResizedFileHolder(cResultsFullGroupDirectory, item, outputResolutionHasNumber);
|
FileHolder resizedFileHolder = _Resize.GetResizedFileHolder(cResultsFullGroupDirectory, item, outputResolutionHasNumber);
|
||||||
if (item.ExifDirectory is null || item.ExifDirectory.FilePath?.Id is null)
|
if (item.ExifDirectory is null || item.ExifDirectory.FilePath?.Id is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (!item.SourceDirectoryFileHolder.Exists || item.SourceDirectoryFileHolder.CreationTime is null || item.SourceDirectoryFileHolder.LastWriteTime is null || item.Any())
|
if (!item.SourceDirectoryFileHolder.Exists || item.SourceDirectoryFileHolder.CreationTime is null || item.SourceDirectoryFileHolder.LastWriteTime is null || item.Any())
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
if (_Configuration.PropertyConfiguration.ForcePropertyLastWriteTimeToCreationTime && item.SourceDirectoryFileHolder.LastWriteTime.Value != item.SourceDirectoryFileHolder.CreationTime.Value)
|
|
||||||
{
|
|
||||||
File.SetLastWriteTime(item.SourceDirectoryFileHolder.FullName, item.SourceDirectoryFileHolder.CreationTime.Value);
|
|
||||||
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Property), item.SourceDirectoryFileHolder.CreationTime.Value));
|
|
||||||
}
|
|
||||||
else if (item.SourceDirectoryFileHolder.LastWriteTime is not null)
|
else if (item.SourceDirectoryFileHolder.LastWriteTime is not null)
|
||||||
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Property), item.SourceDirectoryFileHolder.LastWriteTime.Value));
|
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Property), item.SourceDirectoryFileHolder.LastWriteTime.Value));
|
||||||
else
|
else
|
||||||
@ -323,7 +320,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
}
|
}
|
||||||
|
|
||||||
private (int, bool) FullParallelWork(int maxDegreeOfParallelism,
|
private (int, bool) FullParallelWork(int maxDegreeOfParallelism,
|
||||||
B_Metadata metadata,
|
A_Metadata metadata,
|
||||||
MapLogic mapLogic,
|
MapLogic mapLogic,
|
||||||
string outputResolution,
|
string outputResolution,
|
||||||
bool outputResolutionHasNumber,
|
bool outputResolutionHasNumber,
|
||||||
@ -382,7 +379,7 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
string propertyRoot,
|
string propertyRoot,
|
||||||
string fPhotoPrismSingletonDirectory,
|
string fPhotoPrismSingletonDirectory,
|
||||||
int count,
|
int count,
|
||||||
B_Metadata metadata,
|
A_Metadata metadata,
|
||||||
Record record,
|
Record record,
|
||||||
ReadOnlyCollection<Container.Models.Container> readOnlyContainers,
|
ReadOnlyCollection<Container.Models.Container> readOnlyContainers,
|
||||||
MapLogic mapLogic)
|
MapLogic mapLogic)
|
||||||
@ -478,23 +475,16 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
(string, string) IDlibDotNet.GetResultsFullGroupDirectories()
|
string IDlibDotNet.GetResultsFullGroupDirectories()
|
||||||
{
|
{
|
||||||
string aResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
string result = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
||||||
_Configuration.PropertyConfiguration,
|
_Configuration.PropertyConfiguration,
|
||||||
nameof(A_Property),
|
nameof(A_Metadata),
|
||||||
string.Empty,
|
string.Empty,
|
||||||
includeResizeGroup: false,
|
includeResizeGroup: false,
|
||||||
includeModel: false,
|
includeModel: false,
|
||||||
includePredictorModel: false);
|
includePredictorModel: false);
|
||||||
string bResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
return new(result);
|
||||||
_Configuration.PropertyConfiguration,
|
|
||||||
nameof(B_Metadata),
|
|
||||||
string.Empty,
|
|
||||||
includeResizeGroup: false,
|
|
||||||
includeModel: false,
|
|
||||||
includePredictorModel: false);
|
|
||||||
return new(aResultsFullGroupDirectory, bResultsFullGroupDirectory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IDlibDotNet.ConstructProgressBar(int maxTicks, string message)
|
void IDlibDotNet.ConstructProgressBar(int maxTicks, string message)
|
||||||
@ -1112,12 +1102,10 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
MapLogic? mapLogic;
|
MapLogic? mapLogic;
|
||||||
Record? record = null;
|
Record? record = null;
|
||||||
string seasonDirectory;
|
string seasonDirectory;
|
||||||
A_Property propertyLogic;
|
|
||||||
IDlibDotNet dlibDotNet = this;
|
IDlibDotNet dlibDotNet = this;
|
||||||
DateTime dateTime = new(Ticks);
|
DateTime dateTime = new(Ticks);
|
||||||
string eDistanceContentDirectory;
|
string eDistanceContentDirectory;
|
||||||
string? a2PeopleContentDirectory;
|
string? a2PeopleContentDirectory;
|
||||||
string aResultsFullGroupDirectory;
|
|
||||||
string bResultsFullGroupDirectory;
|
string bResultsFullGroupDirectory;
|
||||||
string cResultsFullGroupDirectory;
|
string cResultsFullGroupDirectory;
|
||||||
string fPhotoPrismContentDirectory;
|
string fPhotoPrismContentDirectory;
|
||||||
@ -1133,14 +1121,14 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
Path.Combine(_Configuration.PropertyConfiguration.RootDirectory, "LinkedIn")
|
Path.Combine(_Configuration.PropertyConfiguration.RootDirectory, "LinkedIn")
|
||||||
];
|
];
|
||||||
bool runToDoCollectionFirst = GetRunToDoCollectionFirst(_Configuration, checkDirectories);
|
bool runToDoCollectionFirst = GetRunToDoCollectionFirst(_Configuration, checkDirectories);
|
||||||
(aResultsFullGroupDirectory, bResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories();
|
bResultsFullGroupDirectory = dlibDotNet.GetResultsFullGroupDirectories();
|
||||||
(int season, string seasonName) = Shared.Models.Stateless.Methods.IProperty.GetSeason(dateTime.DayOfYear);
|
(int season, string seasonName) = Shared.Models.Stateless.Methods.IProperty.GetSeason(dateTime.DayOfYear);
|
||||||
Shared.Models.Stateless.Methods.IPath.ChangeDateForEmptyDirectories(_Configuration.PropertyConfiguration.RootDirectory, dlibDotNet.Ticks);
|
Shared.Models.Stateless.Methods.IPath.ChangeDateForEmptyDirectories(_Configuration.PropertyConfiguration.RootDirectory, dlibDotNet.Ticks);
|
||||||
a2PeopleContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(A2_People), "([])");
|
a2PeopleContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(A2_People), "([])");
|
||||||
eDistanceContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(E_Distance), _Configuration.PropertyConfiguration.ResultContent);
|
eDistanceContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(E_Distance), _Configuration.PropertyConfiguration.ResultContent);
|
||||||
string a2PeopleSingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(A2_People), _Configuration.PropertyConfiguration.ResultSingleton);
|
string a2PeopleSingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(A2_People), _Configuration.PropertyConfiguration.ResultSingleton);
|
||||||
_ = Directory.CreateDirectory(Path.Combine(eDistanceContentDirectory, dlibDotNet.Ticks.ToString()));
|
_ = Directory.CreateDirectory(Path.Combine(eDistanceContentDirectory, dlibDotNet.Ticks.ToString()));
|
||||||
B_Metadata metadata = new(dlibDotNet, _Configuration.PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, dlibDotNet.Ticks, bResultsFullGroupDirectory);
|
A_Metadata metadata = new(dlibDotNet, _Configuration.PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, dlibDotNet.Ticks, bResultsFullGroupDirectory);
|
||||||
if (runToDoCollectionFirst)
|
if (runToDoCollectionFirst)
|
||||||
mapLogic = null;
|
mapLogic = null;
|
||||||
else
|
else
|
||||||
@ -1157,7 +1145,6 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
}
|
}
|
||||||
fPhotoPrismContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(F_PhotoPrism), _Configuration.PropertyConfiguration.ResultContent);
|
fPhotoPrismContentDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(F_PhotoPrism), _Configuration.PropertyConfiguration.ResultContent);
|
||||||
fPhotoPrismSingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(F_PhotoPrism), _Configuration.PropertyConfiguration.ResultSingleton);
|
fPhotoPrismSingletonDirectory = Property.Models.Stateless.IResult.GetResultsDateGroupDirectory(_Configuration.PropertyConfiguration, nameof(F_PhotoPrism), _Configuration.PropertyConfiguration.ResultSingleton);
|
||||||
propertyLogic = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, _Resize.FileNameExtension, _Configuration.Reverse, aResultsFullGroupDirectory);
|
|
||||||
if (record is not null && record.FilesCollectionCountIsOne)
|
if (record is not null && record.FilesCollectionCountIsOne)
|
||||||
{
|
{
|
||||||
if (record.FilePathsCollection is null)
|
if (record.FilePathsCollection is null)
|
||||||
@ -1174,9 +1161,8 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
}
|
}
|
||||||
argZero = SaveUrlAndGetNewRootDirectory(record.FilePathsCollection.First());
|
argZero = SaveUrlAndGetNewRootDirectory(record.FilePathsCollection.First());
|
||||||
_Configuration.PropertyConfiguration.ChangeRootDirectory(argZero);
|
_Configuration.PropertyConfiguration.ChangeRootDirectory(argZero);
|
||||||
(aResultsFullGroupDirectory, bResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories();
|
bResultsFullGroupDirectory = dlibDotNet.GetResultsFullGroupDirectories();
|
||||||
propertyRoot = Property.Models.Stateless.IResult.GetResultsGroupDirectory(_Configuration.PropertyConfiguration, nameof(A_Property), create: false);
|
propertyRoot = Property.Models.Stateless.IResult.GetResultsGroupDirectory(_Configuration.PropertyConfiguration, nameof(A_Metadata), create: false);
|
||||||
propertyLogic = new(_AppSettings.MaxDegreeOfParallelism, _Configuration.PropertyConfiguration, _Resize.FileNameExtension, _Configuration.Reverse, aResultsFullGroupDirectory);
|
|
||||||
}
|
}
|
||||||
if (configurationOutputResolutionsHas)
|
if (configurationOutputResolutionsHas)
|
||||||
{
|
{
|
||||||
@ -1270,7 +1256,6 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
string c2ResultsFullGroupDirectory;
|
string c2ResultsFullGroupDirectory;
|
||||||
string d2ResultsFullGroupDirectory;
|
string d2ResultsFullGroupDirectory;
|
||||||
(cResultsFullGroupDirectory, c2ResultsFullGroupDirectory, dResultsFullGroupDirectory, d2ResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories(outputResolution);
|
(cResultsFullGroupDirectory, c2ResultsFullGroupDirectory, dResultsFullGroupDirectory, d2ResultsFullGroupDirectory) = dlibDotNet.GetResultsFullGroupDirectories(outputResolution);
|
||||||
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(Path.Combine(aResultsFullGroupDirectory, _Configuration.PropertyConfiguration.ResultSingleton));
|
|
||||||
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(Path.Combine(bResultsFullGroupDirectory, _Configuration.PropertyConfiguration.ResultSingleton));
|
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(Path.Combine(bResultsFullGroupDirectory, _Configuration.PropertyConfiguration.ResultSingleton));
|
||||||
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(Path.Combine(cResultsFullGroupDirectory, _Configuration.PropertyConfiguration.ResultSingleton));
|
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(Path.Combine(cResultsFullGroupDirectory, _Configuration.PropertyConfiguration.ResultSingleton));
|
||||||
if (_Configuration.LoadOrCreateThenSaveImageFacesResultsForOutputResolutions.Contains(outputResolution))
|
if (_Configuration.LoadOrCreateThenSaveImageFacesResultsForOutputResolutions.Contains(outputResolution))
|
||||||
@ -1314,10 +1299,10 @@ public partial class DlibDotNet : IDlibDotNet, IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (items.Count > 0)
|
if (items.Count > 0)
|
||||||
throw new Exception($"{items.Count} item(s) of {count} item(s) are not setup!");
|
throw new Exception($"{items.Count} item(s) of {count} item(s) are not setup!{Environment.NewLine}{string.Join(Environment.NewLine, items.Select(l => l.FilePath.FileNameFirstSegment))}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Record GetFilesCollectionThenCopyOrMove(IDlibDotNet dlibDotNet, B_Metadata metadata, string fileSearchFilter, string directorySearchFilter, string bResultsFullGroupDirectory, string outputResolution)
|
private Record GetFilesCollectionThenCopyOrMove(IDlibDotNet dlibDotNet, A_Metadata metadata, string fileSearchFilter, string directorySearchFilter, string bResultsFullGroupDirectory, string outputResolution)
|
||||||
{
|
{
|
||||||
Record result;
|
Record result;
|
||||||
int count;
|
int count;
|
||||||
|
@ -64,20 +64,19 @@ internal abstract class FaceFileLogic
|
|||||||
exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(mappedFile.FilePath);
|
exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(mappedFile.FilePath);
|
||||||
RectangleF? rectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, wholePercentages.Value);
|
RectangleF? rectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, wholePercentages.Value);
|
||||||
personDisplayDirectoryName = mappedFile.PersonDisplayDirectoryName is null ? configuration.MappingDefaultName : mappedFile.PersonDisplayDirectoryName;
|
personDisplayDirectoryName = mappedFile.PersonDisplayDirectoryName is null ? configuration.MappingDefaultName : mappedFile.PersonDisplayDirectoryName;
|
||||||
LocationContainer locationContainer = new(dateOnly,
|
LocationContainer locationContainer = new(CreationDateOnly: dateOnly,
|
||||||
exifDirectory,
|
ExifDirectory: exifDirectory,
|
||||||
mappedFile.DirectoryNumber,
|
DirectoryNumber: mappedFile.DirectoryNumber,
|
||||||
personDisplayDirectoryName,
|
DisplayDirectoryName: personDisplayDirectoryName,
|
||||||
null,
|
Encoding: null,
|
||||||
null,
|
FaceFile: null,
|
||||||
mappedFile.FilePath,
|
FilePath: mappedFile.FilePath,
|
||||||
fromDistanceContent,
|
FromDistanceContent: fromDistanceContent,
|
||||||
id.Value,
|
Id: id.Value,
|
||||||
null,
|
LengthPermyriad: null,
|
||||||
null,
|
LengthSource: null,
|
||||||
mappedFile.PersonKey,
|
PersonKey: mappedFile.PersonKey,
|
||||||
rectangle,
|
WholePercentages: wholePercentages.Value);
|
||||||
wholePercentages.Value);
|
|
||||||
lock (locationContainers)
|
lock (locationContainers)
|
||||||
locationContainers.Add(locationContainer);
|
locationContainers.Add(locationContainer);
|
||||||
}
|
}
|
||||||
@ -167,23 +166,19 @@ internal abstract class FaceFileLogic
|
|||||||
MoveUnableToMatch(filePath);
|
MoveUnableToMatch(filePath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RectangleF? rectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, wholePercentages.Value);
|
LocationContainer locationContainer = new(CreationDateOnly: dateOnly,
|
||||||
if (rectangle is null)
|
ExifDirectory: exifDirectory,
|
||||||
return;
|
DirectoryNumber: null,
|
||||||
LocationContainer locationContainer = new(dateOnly,
|
DisplayDirectoryName: null,
|
||||||
exifDirectory,
|
Encoding: null,
|
||||||
null,
|
FaceFile: faceFile,
|
||||||
null,
|
FilePath: filePath,
|
||||||
null,
|
FromDistanceContent: fromDistanceContent,
|
||||||
faceFile,
|
Id: filePath.Id.Value,
|
||||||
filePath,
|
LengthPermyriad: null,
|
||||||
fromDistanceContent,
|
LengthSource: null,
|
||||||
filePath.Id.Value,
|
PersonKey: null,
|
||||||
null,
|
WholePercentages: wholePercentages.Value);
|
||||||
null,
|
|
||||||
null,
|
|
||||||
rectangle,
|
|
||||||
wholePercentages.Value);
|
|
||||||
lock (locationContainers)
|
lock (locationContainers)
|
||||||
locationContainers.Add(locationContainer);
|
locationContainers.Add(locationContainer);
|
||||||
}
|
}
|
||||||
|
@ -1152,22 +1152,20 @@ internal abstract class MapLogic
|
|||||||
exifDirectory = null;
|
exifDirectory = null;
|
||||||
else
|
else
|
||||||
exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(mappedFile.FilePath);
|
exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(mappedFile.FilePath);
|
||||||
RectangleF? rectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, wholePercentages.Value);
|
|
||||||
personDisplayDirectoryName = mappedFile.PersonDisplayDirectoryName is null ? configuration.MappingDefaultName : mappedFile.PersonDisplayDirectoryName;
|
personDisplayDirectoryName = mappedFile.PersonDisplayDirectoryName is null ? configuration.MappingDefaultName : mappedFile.PersonDisplayDirectoryName;
|
||||||
LocationContainer locationContainer = new(dateOnly,
|
LocationContainer locationContainer = new(CreationDateOnly: dateOnly,
|
||||||
exifDirectory,
|
ExifDirectory: exifDirectory,
|
||||||
mappedFile.DirectoryNumber,
|
DirectoryNumber: mappedFile.DirectoryNumber,
|
||||||
personDisplayDirectoryName,
|
DisplayDirectoryName: personDisplayDirectoryName,
|
||||||
null,
|
Encoding: null,
|
||||||
null,
|
FaceFile: null,
|
||||||
mappedFile.FilePath,
|
FilePath: mappedFile.FilePath,
|
||||||
fromDistanceContent,
|
FromDistanceContent: fromDistanceContent,
|
||||||
id.Value,
|
Id: id.Value,
|
||||||
null,
|
LengthPermyriad: null,
|
||||||
null,
|
LengthSource: null,
|
||||||
mappedFile.PersonKey,
|
PersonKey: mappedFile.PersonKey,
|
||||||
rectangle,
|
WholePercentages: wholePercentages.Value);
|
||||||
wholePercentages.Value);
|
|
||||||
lock (locationContainers)
|
lock (locationContainers)
|
||||||
locationContainers.Add(locationContainer);
|
locationContainers.Add(locationContainer);
|
||||||
}
|
}
|
||||||
@ -1192,12 +1190,18 @@ internal abstract class MapLogic
|
|||||||
if (item.WholePercentages == locationContainer.WholePercentages)
|
if (item.WholePercentages == locationContainer.WholePercentages)
|
||||||
continue;
|
continue;
|
||||||
itemPercentagesRectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, item.WholePercentages);
|
itemPercentagesRectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, item.WholePercentages);
|
||||||
if (itemPercentagesRectangle is null || locationContainer.Rectangle is null)
|
if (itemPercentagesRectangle is null)
|
||||||
percent = null;
|
percent = null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
itemPercentagesArea = itemPercentagesRectangle.Value.Width * itemPercentagesRectangle.Value.Height;
|
RectangleF? rectangle = ILocation.GetPercentagesRectangle(configuration.LocationDigits, item.WholePercentages);
|
||||||
percent = ILocation.GetIntersectPercent(itemPercentagesRectangle.Value, itemPercentagesArea, locationContainer.Rectangle.Value);
|
if (rectangle is null)
|
||||||
|
percent = null;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemPercentagesArea = itemPercentagesRectangle.Value.Width * itemPercentagesRectangle.Value.Height;
|
||||||
|
percent = ILocation.GetIntersectPercent(itemPercentagesRectangle.Value, itemPercentagesArea, rectangle.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete.Add(item.FilePath);
|
delete.Add(item.FilePath);
|
||||||
delete.Add(locationContainer.FilePath);
|
delete.Add(locationContainer.FilePath);
|
||||||
|
@ -54,7 +54,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -68,12 +67,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "D:/Images",
|
"RootDirectory": "D:/Images",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -89,7 +108,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace View_by_Distance.Metadata.Models;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
// Dictionary<string, List<KeyValuePair<string, string>>>
|
// Dictionary<string, List<KeyValuePair<string, string>>>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class B_Metadata : IMetadata<MetadataExtractor.Directory>
|
public class A_Metadata : IMetadata<MetadataExtractor.Directory>
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly Dictionary<int, ExifDirectory> _ExifDirectoriesById;
|
private readonly Dictionary<int, ExifDirectory> _ExifDirectoriesById;
|
||||||
@ -32,7 +32,7 @@ public class B_Metadata : IMetadata<MetadataExtractor.Directory>
|
|||||||
private readonly JsonSerializerOptions _WriteIndentedJsonSerializerOptions;
|
private readonly JsonSerializerOptions _WriteIndentedJsonSerializerOptions;
|
||||||
private readonly ReadOnlyDictionary<byte, ReadOnlyCollection<string>>[] _ResultSingletonFileGroups;
|
private readonly ReadOnlyDictionary<byte, ReadOnlyCollection<string>>[] _ResultSingletonFileGroups;
|
||||||
|
|
||||||
public B_Metadata(IDlibDotNet? dlibDotNet, IPropertyConfiguration propertyConfiguration, bool forceMetadataLastWriteTimeToCreationTime, bool propertiesChangedForMetadata, long ticks, string bResultsFullGroupDirectory)
|
public A_Metadata(IDlibDotNet? dlibDotNet, IPropertyConfiguration propertyConfiguration, bool forceMetadataLastWriteTimeToCreationTime, bool propertiesChangedForMetadata, long ticks, string bResultsFullGroupDirectory)
|
||||||
{
|
{
|
||||||
_PropertyConfiguration = propertyConfiguration;
|
_PropertyConfiguration = propertyConfiguration;
|
||||||
_PropertiesChangedForMetadata = propertiesChangedForMetadata;
|
_PropertiesChangedForMetadata = propertiesChangedForMetadata;
|
||||||
@ -62,7 +62,7 @@ public class B_Metadata : IMetadata<MetadataExtractor.Directory>
|
|||||||
Shared.Models.Stateless.Methods.IPath.CreateDirectories(directories);
|
Shared.Models.Stateless.Methods.IPath.CreateDirectories(directories);
|
||||||
ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection = IDirectory.GetFilePathCollections(propertyConfiguration, directorySearchFilter, fileSearchFilter, filesCollectionRootDirectory, useIgnoreExtensions: true, useCeilingAverage: false);
|
ReadOnlyCollection<ReadOnlyCollection<FilePath>> filePathsCollection = IDirectory.GetFilePathCollections(propertyConfiguration, directorySearchFilter, fileSearchFilter, filesCollectionRootDirectory, useIgnoreExtensions: true, useCeilingAverage: false);
|
||||||
ReadOnlyCollection<FilePair> filePairs = IFilePair.GetFilePairs(propertyConfiguration, directorySearchFilter, extension, jsonGroupSingletonDirectory, filePathsCollection);
|
ReadOnlyCollection<FilePair> filePairs = IFilePair.GetFilePairs(propertyConfiguration, directorySearchFilter, extension, jsonGroupSingletonDirectory, filePathsCollection);
|
||||||
string message = $") {nameof(B_Metadata)} - Preloading ExifDirectory Dictionary - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)";
|
string message = $") {nameof(A_Metadata)} - Preloading ExifDirectory Dictionary - {(int)Math.Floor(new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds)} total second(s)";
|
||||||
dlibDotNet?.ConstructProgressBar(filePairs.Count, message);
|
dlibDotNet?.ConstructProgressBar(filePairs.Count, message);
|
||||||
_ = Parallel.For(0, filePairs.Count, parallelOptions, (i, state) => ParallelFor(filePairs[i], exifDirectoriesById, tick));
|
_ = Parallel.For(0, filePairs.Count, parallelOptions, (i, state) => ParallelFor(filePairs[i], exifDirectoriesById, tick));
|
||||||
_ExifDirectoriesById = exifDirectoriesById;
|
_ExifDirectoriesById = exifDirectoriesById;
|
||||||
@ -156,12 +156,12 @@ public class B_Metadata : IMetadata<MetadataExtractor.Directory>
|
|||||||
result = JsonSerializer.Deserialize(json, ExifDirectorySourceGenerationContext.Default.ExifDirectory);
|
result = JsonSerializer.Deserialize(json, ExifDirectorySourceGenerationContext.Default.ExifDirectory);
|
||||||
if (result is null)
|
if (result is null)
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
subFileTuples.Add(new Tuple<string, DateTime>(nameof(B_Metadata), fileInfo.LastWriteTime));
|
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Metadata), fileInfo.LastWriteTime));
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
parseExceptions.Add(nameof(B_Metadata));
|
parseExceptions.Add(nameof(A_Metadata));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result is null)
|
if (result is null)
|
||||||
@ -173,12 +173,12 @@ public class B_Metadata : IMetadata<MetadataExtractor.Directory>
|
|||||||
if (Shared.Models.Stateless.Methods.IPath.WriteAllText(fileInfo.FullName, json, updateDateWhenMatches, compareBeforeWrite: true, updateToWhenMatches: dateTime))
|
if (Shared.Models.Stateless.Methods.IPath.WriteAllText(fileInfo.FullName, json, updateDateWhenMatches, compareBeforeWrite: true, updateToWhenMatches: dateTime))
|
||||||
{
|
{
|
||||||
if (!_ForceMetadataLastWriteTimeToCreationTime)
|
if (!_ForceMetadataLastWriteTimeToCreationTime)
|
||||||
subFileTuples.Add(new Tuple<string, DateTime>(nameof(B_Metadata), DateTime.Now));
|
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Metadata), DateTime.Now));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
File.SetLastWriteTime(fileInfo.FullName, fileInfo.CreationTime);
|
File.SetLastWriteTime(fileInfo.FullName, fileInfo.CreationTime);
|
||||||
fileInfo.Refresh();
|
fileInfo.Refresh();
|
||||||
subFileTuples.Add(new Tuple<string, DateTime>(nameof(B_Metadata), fileInfo.CreationTime));
|
subFileTuples.Add(new Tuple<string, DateTime>(nameof(A_Metadata), fileInfo.CreationTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -54,7 +54,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -68,12 +67,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "D:/Images",
|
"RootDirectory": "D:/Images",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -89,7 +108,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -67,12 +66,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "D:/Images",
|
"RootDirectory": "D:/Images",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -88,7 +107,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
"Configuration": {
|
"Configuration": {
|
||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"KeepFullPath": false,
|
"KeepFullPath": false,
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -60,12 +59,32 @@
|
|||||||
"PropertiesChangedForProperty": false,
|
"PropertiesChangedForProperty": false,
|
||||||
"RootDirectory": "C:/Tmp/Phares/Pictures",
|
"RootDirectory": "C:/Tmp/Phares/Pictures",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"PropertyContentCollectionFiles": [],
|
"PropertyContentCollectionFiles": [],
|
||||||
"Spelling": [
|
"Spelling": [
|
||||||
@ -108,7 +127,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
],
|
],
|
||||||
"VerifyToSeason": [
|
"VerifyToSeason": [
|
||||||
". 2000",
|
". 2000",
|
||||||
|
@ -9,7 +9,6 @@ public class Configuration
|
|||||||
|
|
||||||
public string? DateGroup { get; set; }
|
public string? DateGroup { get; set; }
|
||||||
public string? FileNameDirectorySeparator { get; set; }
|
public string? FileNameDirectorySeparator { get; set; }
|
||||||
public bool? ForcePropertyLastWriteTimeToCreationTime { get; set; }
|
|
||||||
public string[]? IgnoreExtensions { get; set; }
|
public string[]? IgnoreExtensions { get; set; }
|
||||||
public string[]? IgnoreRulesKeyWords { get; set; }
|
public string[]? IgnoreRulesKeyWords { get; set; }
|
||||||
public int? IntMinValueLength { get; set; }
|
public int? IntMinValueLength { get; set; }
|
||||||
@ -64,7 +63,6 @@ public class Configuration
|
|||||||
if (configuration is null) throw new NullReferenceException(nameof(configuration));
|
if (configuration is null) throw new NullReferenceException(nameof(configuration));
|
||||||
if (configuration.DateGroup is null) throw new NullReferenceException(nameof(configuration.DateGroup));
|
if (configuration.DateGroup is null) throw new NullReferenceException(nameof(configuration.DateGroup));
|
||||||
if (configuration.FileNameDirectorySeparator is null) throw new NullReferenceException(nameof(configuration.FileNameDirectorySeparator));
|
if (configuration.FileNameDirectorySeparator is null) throw new NullReferenceException(nameof(configuration.FileNameDirectorySeparator));
|
||||||
if (configuration.ForcePropertyLastWriteTimeToCreationTime is null) throw new NullReferenceException(nameof(configuration.ForcePropertyLastWriteTimeToCreationTime));
|
|
||||||
if (configuration.IgnoreExtensions is null) throw new NullReferenceException(nameof(configuration.IgnoreExtensions));
|
if (configuration.IgnoreExtensions is null) throw new NullReferenceException(nameof(configuration.IgnoreExtensions));
|
||||||
if (configuration.IgnoreRulesKeyWords is null) throw new NullReferenceException(nameof(configuration.IgnoreRulesKeyWords));
|
if (configuration.IgnoreRulesKeyWords is null) throw new NullReferenceException(nameof(configuration.IgnoreRulesKeyWords));
|
||||||
if (configuration.IntMinValueLength is null) throw new NullReferenceException(nameof(configuration.IntMinValueLength));
|
if (configuration.IntMinValueLength is null) throw new NullReferenceException(nameof(configuration.IntMinValueLength));
|
||||||
@ -91,7 +89,6 @@ public class Configuration
|
|||||||
// if (configuration.VerifyToSeason is null) throw new NullReferenceException(nameof(configuration.VerifyToSeason));
|
// if (configuration.VerifyToSeason is null) throw new NullReferenceException(nameof(configuration.VerifyToSeason));
|
||||||
result = new(configuration.DateGroup,
|
result = new(configuration.DateGroup,
|
||||||
configuration.FileNameDirectorySeparator,
|
configuration.FileNameDirectorySeparator,
|
||||||
configuration.ForcePropertyLastWriteTimeToCreationTime.Value,
|
|
||||||
configuration.IgnoreExtensions,
|
configuration.IgnoreExtensions,
|
||||||
configuration.IgnoreRulesKeyWords,
|
configuration.IgnoreRulesKeyWords,
|
||||||
configuration.IntMinValueLength.Value,
|
configuration.IntMinValueLength.Value,
|
||||||
|
@ -12,7 +12,6 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
|||||||
|
|
||||||
public string DateGroup { init; get; }
|
public string DateGroup { init; get; }
|
||||||
public string FileNameDirectorySeparator { init; get; }
|
public string FileNameDirectorySeparator { init; get; }
|
||||||
public bool ForcePropertyLastWriteTimeToCreationTime { init; get; }
|
|
||||||
public string[] IgnoreExtensions { init; get; }
|
public string[] IgnoreExtensions { init; get; }
|
||||||
public string[] IgnoreRulesKeyWords { init; get; }
|
public string[] IgnoreRulesKeyWords { init; get; }
|
||||||
public int IntMinValueLength { init; get; }
|
public int IntMinValueLength { init; get; }
|
||||||
@ -39,7 +38,6 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
|||||||
[JsonConstructor]
|
[JsonConstructor]
|
||||||
public Configuration(string dateGroup,
|
public Configuration(string dateGroup,
|
||||||
string fileNameDirectorySeparator,
|
string fileNameDirectorySeparator,
|
||||||
bool forcePropertyLastWriteTimeToCreationTime,
|
|
||||||
string[] ignoreExtensions,
|
string[] ignoreExtensions,
|
||||||
string[] ignoreRulesKeyWords,
|
string[] ignoreRulesKeyWords,
|
||||||
int intMinValueLength,
|
int intMinValueLength,
|
||||||
@ -67,7 +65,6 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
|||||||
{
|
{
|
||||||
DateGroup = dateGroup;
|
DateGroup = dateGroup;
|
||||||
FileNameDirectorySeparator = fileNameDirectorySeparator;
|
FileNameDirectorySeparator = fileNameDirectorySeparator;
|
||||||
ForcePropertyLastWriteTimeToCreationTime = forcePropertyLastWriteTimeToCreationTime;
|
|
||||||
IgnoreExtensions = ignoreExtensions;
|
IgnoreExtensions = ignoreExtensions;
|
||||||
IgnoreRulesKeyWords = ignoreRulesKeyWords;
|
IgnoreRulesKeyWords = ignoreRulesKeyWords;
|
||||||
IntMinValueLength = intMinValueLength;
|
IntMinValueLength = intMinValueLength;
|
||||||
|
27
Rename/.vscode/appsettings.example.json
vendored
27
Rename/.vscode/appsettings.example.json
vendored
@ -65,7 +65,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -82,12 +81,32 @@
|
|||||||
"xxxRootDirectory": "D:/1-Images-A/Images-dd514b88/Facebook/2023.3 Facebook",
|
"xxxRootDirectory": "D:/1-Images-A/Images-dd514b88/Facebook/2023.3 Facebook",
|
||||||
"RootDirectory": "D:/7-Question/California",
|
"RootDirectory": "D:/7-Question/California",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -103,7 +122,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -85,7 +85,7 @@ public class Rename
|
|||||||
const bool useCeilingAverage = false;
|
const bool useCeilingAverage = false;
|
||||||
const string directorySearchFilter = "*";
|
const string directorySearchFilter = "*";
|
||||||
List<string> distinctDirectories = [];
|
List<string> distinctDirectories = [];
|
||||||
B_Metadata metadata = new(_PropertyConfiguration);
|
A_Metadata metadata = new(_PropertyConfiguration);
|
||||||
List<(FileHolder, string, string)> toDoCollection = [];
|
List<(FileHolder, string, string)> toDoCollection = [];
|
||||||
List<(FileHolder, string)> verifiedToDoCollection = [];
|
List<(FileHolder, string)> verifiedToDoCollection = [];
|
||||||
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
ProgressBarOptions options = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
|
||||||
@ -209,7 +209,7 @@ public class Rename
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Record> GetRecords(B_Metadata metadata, int offset, ProgressBar progressBar, string[] files)
|
private List<Record> GetRecords(A_Metadata metadata, int offset, ProgressBar progressBar, string[] files)
|
||||||
{
|
{
|
||||||
List<Record> results = [];
|
List<Record> results = [];
|
||||||
int? id;
|
int? id;
|
||||||
|
@ -195,7 +195,7 @@ public class C_Resize
|
|||||||
{
|
{
|
||||||
Dictionary<string, int[]>? results;
|
Dictionary<string, int[]>? results;
|
||||||
string json;
|
string json;
|
||||||
string[] changesFrom = [nameof(A_Property), nameof(B_Metadata)];
|
string[] changesFrom = [nameof(A_Metadata)];
|
||||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||||
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
CombinedEnumAndIndex cei = Shared.Models.Stateless.Methods.IPath.GetCombinedEnumAndIndex(_PropertyConfiguration, filePath);
|
||||||
string fileName = $"{mappingFromItem.FilePath.NameWithoutExtension}{mappingFromItem.FilePath.ExtensionLowered}.json";
|
string fileName = $"{mappingFromItem.FilePath.NameWithoutExtension}{mappingFromItem.FilePath.ExtensionLowered}.json";
|
||||||
@ -353,7 +353,7 @@ public class C_Resize
|
|||||||
int outputResolutionHeight = resize[_OutputResolutionHeightIndex];
|
int outputResolutionHeight = resize[_OutputResolutionHeightIndex];
|
||||||
int outputResolutionOrientation = resize[_OutputResolutionOrientationIndex];
|
int outputResolutionOrientation = resize[_OutputResolutionOrientationIndex];
|
||||||
int[] originalCollection = outputResolutionToResize[_Original];
|
int[] originalCollection = outputResolutionToResize[_Original];
|
||||||
string[] changesFrom = [nameof(A_Property), nameof(B_Metadata), nameof(C_Resize)];
|
string[] changesFrom = [nameof(A_Metadata), nameof(C_Resize)];
|
||||||
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
List<DateTime> dateTimes = (from l in subFileTuples where changesFrom.Contains(l.Item1) select l.Item2).ToList();
|
||||||
if (_OverrideForResizeImages)
|
if (_OverrideForResizeImages)
|
||||||
check = true;
|
check = true;
|
||||||
|
@ -64,7 +64,7 @@ public class SetCreatedDate
|
|||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Record> GetRecords(ProgressBar progressBar, ASCIIEncoding asciiEncoding, B_Metadata metadata, string[] files)
|
private List<Record> GetRecords(ProgressBar progressBar, ASCIIEncoding asciiEncoding, A_Metadata metadata, string[] files)
|
||||||
{
|
{
|
||||||
List<Record> results = [];
|
List<Record> results = [];
|
||||||
int? id;
|
int? id;
|
||||||
@ -102,7 +102,7 @@ public class SetCreatedDate
|
|||||||
Record[] records;
|
Record[] records;
|
||||||
List<Record> unordered;
|
List<Record> unordered;
|
||||||
ASCIIEncoding asciiEncoding = new();
|
ASCIIEncoding asciiEncoding = new();
|
||||||
B_Metadata metadata = new(_PropertyConfiguration);
|
A_Metadata metadata = new(_PropertyConfiguration);
|
||||||
List<Record[]> collections = [];
|
List<Record[]> collections = [];
|
||||||
foreach (string[] files in filesCollection)
|
foreach (string[] files in filesCollection)
|
||||||
{
|
{
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
"DateGroup": "dd514b88",
|
"DateGroup": "dd514b88",
|
||||||
"DiffPropertyDirectory": "",
|
"DiffPropertyDirectory": "",
|
||||||
"FileNameDirectorySeparator": ".Z.",
|
"FileNameDirectorySeparator": ".Z.",
|
||||||
"ForcePropertyLastWriteTimeToCreationTime": false,
|
|
||||||
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
"MaxImagesInDirectoryForTopLevelFirstPass": 10,
|
||||||
"OutputExtension": ".jpg",
|
"OutputExtension": ".jpg",
|
||||||
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
"Pattern": "[^ABCDEFGHIJKLMNOPQRSTUVWXYZbcdfghjklmnpqrstvwxyz0-9]",
|
||||||
@ -69,12 +68,32 @@
|
|||||||
"ResultSingleton": "{}",
|
"ResultSingleton": "{}",
|
||||||
"RootDirectory": "D:/Images",
|
"RootDirectory": "D:/Images",
|
||||||
"IgnoreExtensions": [
|
"IgnoreExtensions": [
|
||||||
|
".ffs_db",
|
||||||
|
".FFS_DB",
|
||||||
".gif",
|
".gif",
|
||||||
".GIF",
|
".GIF",
|
||||||
|
".html",
|
||||||
|
".HTML",
|
||||||
|
".ico",
|
||||||
|
".ICO",
|
||||||
|
".json",
|
||||||
|
".JSON",
|
||||||
|
".lnk",
|
||||||
|
".LNK",
|
||||||
|
".lsv",
|
||||||
|
".LSV",
|
||||||
".nef",
|
".nef",
|
||||||
".NEF",
|
".NEF",
|
||||||
".pdf",
|
".pdf",
|
||||||
".PDF"
|
".PDF",
|
||||||
|
".ts",
|
||||||
|
".TS",
|
||||||
|
".txt",
|
||||||
|
".TXT",
|
||||||
|
".webp",
|
||||||
|
".WEBP",
|
||||||
|
".xmp",
|
||||||
|
".XMP"
|
||||||
],
|
],
|
||||||
"ValidImageFormatExtensions": [
|
"ValidImageFormatExtensions": [
|
||||||
".bmp",
|
".bmp",
|
||||||
@ -90,7 +109,9 @@
|
|||||||
".tiff",
|
".tiff",
|
||||||
".TIFF",
|
".TIFF",
|
||||||
".tif",
|
".tif",
|
||||||
".TIF"
|
".TIF",
|
||||||
|
".webp",
|
||||||
|
".WEBP"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class Location : Properties.ILocation, IEquatable<Location>
|
|||||||
_ = Stateless.Methods.Location.Check(bottom, left, right, top, zCount: 1, throwException: true);
|
_ = Stateless.Methods.Location.Check(bottom, left, right, top, zCount: 1, throwException: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location(double confidence, int height, Location location, int locationDigits, int locationFactor, int width, int zCount) :
|
public Location(double confidence, int height, Location location, int width, int zCount) :
|
||||||
this(
|
this(
|
||||||
location.Bottom,
|
location.Bottom,
|
||||||
confidence,
|
confidence,
|
||||||
@ -32,7 +32,7 @@ public class Location : Properties.ILocation, IEquatable<Location>
|
|||||||
location.Top) =>
|
location.Top) =>
|
||||||
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
||||||
|
|
||||||
public Location(int bottom, double confidence, int height, int left, int locationDigits, int locationFactor, int right, int top, int width, int zCount) :
|
public Location(int bottom, double confidence, int height, int left, int right, int top, int width, int zCount) :
|
||||||
this(
|
this(
|
||||||
bottom,
|
bottom,
|
||||||
confidence,
|
confidence,
|
||||||
@ -41,7 +41,7 @@ public class Location : Properties.ILocation, IEquatable<Location>
|
|||||||
top) =>
|
top) =>
|
||||||
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
||||||
|
|
||||||
public Location(int height, Location location, int locationDigits, int locationFactor, int width, int zCount) :
|
public Location(int height, Location location, int width, int zCount) :
|
||||||
this(
|
this(
|
||||||
location.Bottom,
|
location.Bottom,
|
||||||
location.Confidence,
|
location.Confidence,
|
||||||
@ -50,7 +50,7 @@ public class Location : Properties.ILocation, IEquatable<Location>
|
|||||||
location.Top) =>
|
location.Top) =>
|
||||||
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
Stateless.Methods.Location.Check(Bottom, height, Left, Right, Top, width, zCount, throwException: true);
|
||||||
|
|
||||||
public Location(double confidence, int factor, int height, Location location, int locationDigits, int locationFactor, int width, int zCount)
|
public Location(double confidence, int factor, int height, Location location, int width, int zCount)
|
||||||
{
|
{
|
||||||
int x = (location.Right - location.Left) / factor;
|
int x = (location.Right - location.Left) / factor;
|
||||||
int y = (location.Bottom - location.Top) / factor;
|
int y = (location.Bottom - location.Top) / factor;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace View_by_Distance.Shared.Models;
|
namespace View_by_Distance.Shared.Models;
|
||||||
|
|
||||||
public record LocationContainer(DateOnly CreationDateOnly,
|
public record LocationContainer(DateOnly CreationDateOnly,
|
||||||
@ -14,47 +12,44 @@ public record LocationContainer(DateOnly CreationDateOnly,
|
|||||||
int? LengthPermyriad,
|
int? LengthPermyriad,
|
||||||
FilePath? LengthSource,
|
FilePath? LengthSource,
|
||||||
long? PersonKey,
|
long? PersonKey,
|
||||||
RectangleF? Rectangle,
|
|
||||||
int WholePercentages)
|
int WholePercentages)
|
||||||
{
|
{
|
||||||
|
|
||||||
public static LocationContainer Get(LocationContainer locationContainer, object? encoding, bool keepExifDirectory)
|
public static LocationContainer Get(LocationContainer locationContainer, object? encoding, bool keepExifDirectory)
|
||||||
{
|
{
|
||||||
LocationContainer result;
|
LocationContainer result;
|
||||||
result = new(locationContainer.CreationDateOnly,
|
result = new(CreationDateOnly: locationContainer.CreationDateOnly,
|
||||||
keepExifDirectory ? locationContainer.ExifDirectory : null,
|
ExifDirectory: keepExifDirectory ? locationContainer.ExifDirectory : null,
|
||||||
locationContainer.DirectoryNumber,
|
DirectoryNumber: locationContainer.DirectoryNumber,
|
||||||
locationContainer.DisplayDirectoryName,
|
DisplayDirectoryName: locationContainer.DisplayDirectoryName,
|
||||||
encoding,
|
Encoding: encoding,
|
||||||
locationContainer.FaceFile,
|
FaceFile: locationContainer.FaceFile,
|
||||||
locationContainer.FilePath,
|
FilePath: locationContainer.FilePath,
|
||||||
locationContainer.FromDistanceContent,
|
FromDistanceContent: locationContainer.FromDistanceContent,
|
||||||
locationContainer.Id,
|
Id: locationContainer.Id,
|
||||||
locationContainer.LengthPermyriad,
|
LengthPermyriad: locationContainer.LengthPermyriad,
|
||||||
locationContainer.LengthSource,
|
LengthSource: locationContainer.LengthSource,
|
||||||
locationContainer.PersonKey,
|
PersonKey: locationContainer.PersonKey,
|
||||||
locationContainer.Rectangle,
|
WholePercentages: locationContainer.WholePercentages);
|
||||||
locationContainer.WholePercentages);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LocationContainer Get(LocationContainer source, LocationContainer locationContainer, int lengthPermyriad, bool keepExifDirectory, bool keepEncoding)
|
public static LocationContainer Get(LocationContainer source, LocationContainer locationContainer, int lengthPermyriad, bool keepExifDirectory, bool keepEncoding)
|
||||||
{
|
{
|
||||||
LocationContainer result;
|
LocationContainer result;
|
||||||
result = new(locationContainer.CreationDateOnly,
|
result = new(CreationDateOnly: locationContainer.CreationDateOnly,
|
||||||
keepExifDirectory ? locationContainer.ExifDirectory : null,
|
ExifDirectory: keepExifDirectory ? locationContainer.ExifDirectory : null,
|
||||||
locationContainer.DirectoryNumber,
|
DirectoryNumber: locationContainer.DirectoryNumber,
|
||||||
locationContainer.DisplayDirectoryName,
|
DisplayDirectoryName: locationContainer.DisplayDirectoryName,
|
||||||
keepEncoding ? locationContainer.Encoding : null,
|
Encoding: keepEncoding ? locationContainer.Encoding : null,
|
||||||
locationContainer.FaceFile,
|
FaceFile: locationContainer.FaceFile,
|
||||||
locationContainer.FilePath,
|
FilePath: locationContainer.FilePath,
|
||||||
locationContainer.FromDistanceContent,
|
FromDistanceContent: locationContainer.FromDistanceContent,
|
||||||
locationContainer.Id,
|
Id: locationContainer.Id,
|
||||||
lengthPermyriad,
|
LengthPermyriad: lengthPermyriad,
|
||||||
source.FilePath,
|
LengthSource: source.FilePath,
|
||||||
locationContainer.PersonKey,
|
PersonKey: locationContainer.PersonKey,
|
||||||
locationContainer.Rectangle,
|
WholePercentages: locationContainer.WholePercentages);
|
||||||
locationContainer.WholePercentages);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ public interface IPropertyConfiguration
|
|||||||
public string[] IgnoreRulesKeyWords { init; get; }
|
public string[] IgnoreRulesKeyWords { init; get; }
|
||||||
public int IntMinValueLength { init; get; }
|
public int IntMinValueLength { init; get; }
|
||||||
public string PersonBirthdayFormat { init; get; }
|
public string PersonBirthdayFormat { init; get; }
|
||||||
public bool PropertiesChangedForProperty { init; get; }
|
|
||||||
public string[] PropertyContentCollectionFiles { init; get; }
|
public string[] PropertyContentCollectionFiles { init; get; }
|
||||||
public string ResultAllInOne { init; get; }
|
public string ResultAllInOne { init; get; }
|
||||||
public int ResultAllInOneSubdirectoryLength { init; get; }
|
public int ResultAllInOneSubdirectoryLength { init; get; }
|
||||||
|
@ -5,7 +5,8 @@ public interface IDlibDotNet
|
|||||||
|
|
||||||
void Tick();
|
void Tick();
|
||||||
long Ticks { get; }
|
long Ticks { get; }
|
||||||
(string, string) GetResultsFullGroupDirectories();
|
int? CurrentTick { get; }
|
||||||
|
string GetResultsFullGroupDirectories();
|
||||||
void ConstructProgressBar(int maxTicks, string message);
|
void ConstructProgressBar(int maxTicks, string message);
|
||||||
(string, string, string, string) GetResultsFullGroupDirectories(string outputResolution);
|
(string, string, string, string) GetResultsFullGroupDirectories(string outputResolution);
|
||||||
|
|
||||||
|
@ -55,15 +55,15 @@ public interface ILocation
|
|||||||
static string GetLeftPadded(int locationDigits, int value) =>
|
static string GetLeftPadded(int locationDigits, int value) =>
|
||||||
GetLeftPadded(locationDigits, value.ToString());
|
GetLeftPadded(locationDigits, value.ToString());
|
||||||
|
|
||||||
Models.Location? TestStatic_GetLocation(Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
|
Models.Location? TestStatic_GetLocation(Models.Location? location, int height, int width, int zCount) =>
|
||||||
GetLocation(location, locationDigits, locationFactor, height, width, zCount);
|
GetLocation(location, height, width, zCount);
|
||||||
static Models.Location? GetLocation(Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
|
static Models.Location? GetLocation(Models.Location? location, int height, int width, int zCount) =>
|
||||||
location is null ? null : new(location.Confidence, height, location, locationDigits, locationFactor, width, zCount);
|
location is null ? null : new(location.Confidence, height, location, width, zCount);
|
||||||
|
|
||||||
Models.Location? TestStatic_GetLocation(int factor, Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
|
Models.Location? TestStatic_GetLocation(int factor, Models.Location? location, int height, int width, int zCount) =>
|
||||||
GetLocation(factor, location, locationDigits, locationFactor, height, width, zCount);
|
GetLocation(factor, location, height, width, zCount);
|
||||||
static Models.Location? GetLocation(int factor, Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
|
static Models.Location? GetLocation(int factor, Models.Location? location, int height, int width, int zCount) =>
|
||||||
location is null ? null : new(location.Confidence, factor, height, location, locationDigits, locationFactor, width, zCount);
|
location is null ? null : new(location.Confidence, factor, height, location, width, zCount);
|
||||||
|
|
||||||
(decimal?, decimal?, decimal?, decimal?) TestStatic_GetHeightLeftTopWidth(int bottom, int height, int left, int right, int top, int width) =>
|
(decimal?, decimal?, decimal?, decimal?) TestStatic_GetHeightLeftTopWidth(int bottom, int height, int left, int right, int top, int width) =>
|
||||||
GetHeightLeftTopWidth(bottom, height, left, right, top, width);
|
GetHeightLeftTopWidth(bottom, height, left, right, top, width);
|
||||||
@ -107,8 +107,6 @@ public interface ILocation
|
|||||||
detectionConfidence,
|
detectionConfidence,
|
||||||
height,
|
height,
|
||||||
Math.Max(rectangle.Left, 0),
|
Math.Max(rectangle.Left, 0),
|
||||||
Stateless.ILocation.Digits,
|
|
||||||
Stateless.ILocation.Factor,
|
|
||||||
Math.Min(rectangle.Right, width),
|
Math.Min(rectangle.Right, width),
|
||||||
Math.Max(rectangle.Top, 0),
|
Math.Max(rectangle.Top, 0),
|
||||||
width,
|
width,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
|
using View_by_Distance.Shared.Models.Properties;
|
||||||
|
|
||||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||||
|
|
||||||
@ -27,7 +28,20 @@ internal abstract class Id
|
|||||||
internal static byte GetHasIgnoreKeyword(FilePath filePath) =>
|
internal static byte GetHasIgnoreKeyword(FilePath filePath) =>
|
||||||
(byte)(filePath.Id > -1 ? 8 : 2);
|
(byte)(filePath.Id > -1 ? 8 : 2);
|
||||||
|
|
||||||
internal static int GetId(Properties.IPropertyConfiguration propertyConfiguration, string intelligentId)
|
internal static byte GetHasDateTimeOriginal(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||||
|
(byte)(IsIgnoreOrValidVideoFormatExtension(propertyConfiguration, filePath) ? filePath.Id > -1 ? 6 : 4 : filePath.Id > -1 ? 9 : 1);
|
||||||
|
|
||||||
|
private static bool IsIgnoreOrValidVideoFormatExtension(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||||
|
IsIgnoreOrValidVideoFormatExtension(propertyConfiguration, filePath.ExtensionLowered);
|
||||||
|
|
||||||
|
private static bool IsIgnoreOrValidVideoFormatExtension(IPropertyConfiguration propertyConfiguration, string extensionLowered) =>
|
||||||
|
propertyConfiguration.IgnoreExtensions.Contains(extensionLowered)
|
||||||
|
|| propertyConfiguration.ValidVideoFormatExtensions.Contains(extensionLowered);
|
||||||
|
|
||||||
|
internal static byte GetMissingDateTimeOriginal(IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
||||||
|
(byte)(IsIgnoreOrValidVideoFormatExtension(propertyConfiguration, filePath) ? filePath.Id > -1 ? 5 : 0 : filePath.Id > -1 ? 7 : 3);
|
||||||
|
|
||||||
|
internal static int GetId(IPropertyConfiguration propertyConfiguration, string intelligentId)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
StringBuilder results = new();
|
StringBuilder results = new();
|
||||||
@ -44,13 +58,7 @@ internal abstract class Id
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static byte GetHasDateTimeOriginal(Properties.IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
internal static bool NameWithoutExtensionIsIdFormat(IPropertyConfiguration propertyConfiguration, string fileNameWithoutExtension)
|
||||||
(byte)(propertyConfiguration.IgnoreExtensions.Contains(filePath.ExtensionLowered) || propertyConfiguration.ValidVideoFormatExtensions.Contains(filePath.ExtensionLowered) ? filePath.Id > -1 ? 6 : 4 : filePath.Id > -1 ? 9 : 1);
|
|
||||||
|
|
||||||
internal static byte GetMissingDateTimeOriginal(Properties.IPropertyConfiguration propertyConfiguration, FilePath filePath) =>
|
|
||||||
(byte)(propertyConfiguration.IgnoreExtensions.Contains(filePath.ExtensionLowered) || propertyConfiguration.ValidVideoFormatExtensions.Contains(filePath.ExtensionLowered) ? filePath.Id > -1 ? 5 : 0 : filePath.Id > -1 ? 7 : 3);
|
|
||||||
|
|
||||||
internal static bool NameWithoutExtensionIsIdFormat(Properties.IPropertyConfiguration propertyConfiguration, string fileNameWithoutExtension)
|
|
||||||
{
|
{
|
||||||
bool result;
|
bool result;
|
||||||
if (fileNameWithoutExtension.Length < 5 || fileNameWithoutExtension.Length > propertyConfiguration.IntMinValueLength)
|
if (fileNameWithoutExtension.Length < 5 || fileNameWithoutExtension.Length > propertyConfiguration.IntMinValueLength)
|
||||||
@ -63,7 +71,7 @@ internal abstract class Id
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetIntelligentId(Properties.IPropertyConfiguration propertyConfiguration, long id, string extensionLowered, bool? hasIgnoreKeyword, bool? hasDateTimeOriginal)
|
internal static string GetIntelligentId(IPropertyConfiguration propertyConfiguration, long id, string extensionLowered, bool? hasIgnoreKeyword, bool? hasDateTimeOriginal)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
@ -79,18 +87,18 @@ internal abstract class Id
|
|||||||
}
|
}
|
||||||
else if (id > -1)
|
else if (id > -1)
|
||||||
{
|
{
|
||||||
if (!propertyConfiguration.ValidVideoFormatExtensions.Contains(extensionLowered))
|
if (IsIgnoreOrValidVideoFormatExtension(propertyConfiguration, extensionLowered))
|
||||||
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? 8 : hasDateTimeOriginal.Value ? 9 : 7;
|
|
||||||
else
|
|
||||||
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? throw new NotImplementedException() : hasDateTimeOriginal.Value ? 6 : 5;
|
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? throw new NotImplementedException() : hasDateTimeOriginal.Value ? 6 : 5;
|
||||||
|
else
|
||||||
|
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? 8 : hasDateTimeOriginal.Value ? 9 : 7;
|
||||||
value = id.ToString().PadLeft(propertyConfiguration.IntMinValueLength, '0');
|
value = id.ToString().PadLeft(propertyConfiguration.IntMinValueLength, '0');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!propertyConfiguration.ValidVideoFormatExtensions.Contains(extensionLowered))
|
if (IsIgnoreOrValidVideoFormatExtension(propertyConfiguration, extensionLowered))
|
||||||
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? 2 : hasDateTimeOriginal.Value ? 1 : 3;
|
|
||||||
else
|
|
||||||
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? throw new NotImplementedException() : hasDateTimeOriginal.Value ? 4 : 0;
|
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? throw new NotImplementedException() : hasDateTimeOriginal.Value ? 4 : 0;
|
||||||
|
else
|
||||||
|
key = hasIgnoreKeyword is not null && hasIgnoreKeyword.Value ? 2 : hasDateTimeOriginal.Value ? 1 : 3;
|
||||||
value = id.ToString()[1..].PadLeft(propertyConfiguration.IntMinValueLength, '0');
|
value = id.ToString()[1..].PadLeft(propertyConfiguration.IntMinValueLength, '0');
|
||||||
}
|
}
|
||||||
for (int i = value.Length - propertyConfiguration.ResultAllInOneSubdirectoryLength - 1; i > -1; i--)
|
for (int i = value.Length - propertyConfiguration.ResultAllInOneSubdirectoryLength - 1; i > -1; i--)
|
||||||
@ -101,7 +109,7 @@ internal abstract class Id
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetPaddedId(Properties.IPropertyConfiguration propertyConfiguration, int id, string extensionLowered, bool? hasIgnoreKeyword, bool? hasDateTimeOriginal, int? index)
|
internal static string GetPaddedId(IPropertyConfiguration propertyConfiguration, int id, string extensionLowered, bool? hasIgnoreKeyword, bool? hasDateTimeOriginal, int? index)
|
||||||
{
|
{
|
||||||
string result;
|
string result;
|
||||||
if (propertyConfiguration.Offset < 0)
|
if (propertyConfiguration.Offset < 0)
|
||||||
|
@ -136,7 +136,10 @@ internal abstract class Location
|
|||||||
result = null;
|
result = null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!int.TryParse(segments[1], out int xWholePercent) || !int.TryParse(segments[2], out int yWholePercent) || !int.TryParse(segments[3], out int wWholePercent) || !int.TryParse(segments[4], out int hWholePercent))
|
if (!int.TryParse(segments[1], out int xWholePercent)
|
||||||
|
|| !int.TryParse(segments[2], out int yWholePercent)
|
||||||
|
|| !int.TryParse(segments[3], out int wWholePercent)
|
||||||
|
|| !int.TryParse(segments[4], out int hWholePercent))
|
||||||
result = null;
|
result = null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||||
|
|
||||||
@ -384,7 +385,12 @@ internal abstract partial class XDirectory
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (filePath.Id is null)
|
if (filePath.Id is null)
|
||||||
throw new NullReferenceException(nameof(filePath.Id));
|
{
|
||||||
|
if (Debugger.IsAttached)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
throw new NullReferenceException(nameof(filePath.Id));
|
||||||
|
}
|
||||||
intelligentId = IId.GetIntelligentId(propertyConfiguration, filePath.Id.Value, filePath.ExtensionLowered, filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
intelligentId = IId.GetIntelligentId(propertyConfiguration, filePath.Id.Value, filePath.ExtensionLowered, filePath.HasIgnoreKeyword, filePath.HasDateTimeOriginal);
|
||||||
if (!isOffsetDeterministicHashCode)
|
if (!isOffsetDeterministicHashCode)
|
||||||
checkFile = Path.Combine(directory, $"{intelligentId}{filePath.ExtensionLowered}");
|
checkFile = Path.Combine(directory, $"{intelligentId}{filePath.ExtensionLowered}");
|
||||||
|
@ -162,8 +162,8 @@ public partial class UnitTestCalculations
|
|||||||
width = 100;
|
width = 100;
|
||||||
height = 100;
|
height = 100;
|
||||||
Location location = new(bottom, confidence, left, right, top);
|
Location location = new(bottom, confidence, left, right, top);
|
||||||
_ = new Location(confidence, height, location, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, width, 1);
|
_ = new Location(confidence, height, location, width, 1);
|
||||||
_ = new Location(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
_ = new Location(bottom, confidence, height, left, right, top, width, 1);
|
||||||
NonThrowTryCatch();
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ public partial class UnitTestCalculations
|
|||||||
bottom = 50;
|
bottom = 50;
|
||||||
width = 100;
|
width = 100;
|
||||||
height = 100;
|
height = 100;
|
||||||
location = new(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
location = new(bottom, confidence, height, left, right, top, width, 1);
|
||||||
areaPermyriad = IMapping.GetAreaPermyriad(faceAreaPermyriad, height, location, width);
|
areaPermyriad = IMapping.GetAreaPermyriad(faceAreaPermyriad, height, location, width);
|
||||||
Assert.IsTrue(areaPermyriad == 2500);
|
Assert.IsTrue(areaPermyriad == 2500);
|
||||||
left = 0;
|
left = 0;
|
||||||
@ -197,7 +197,7 @@ public partial class UnitTestCalculations
|
|||||||
bottom = 25;
|
bottom = 25;
|
||||||
width = 100;
|
width = 100;
|
||||||
height = 100;
|
height = 100;
|
||||||
location = new(bottom, confidence, height, left, Shared.Models.Stateless.ILocation.Digits, Shared.Models.Stateless.ILocation.Factor, right, top, width, 1);
|
location = new(bottom, confidence, height, left, right, top, width, 1);
|
||||||
OutputResolution outputResolution = new(height, 0, width);
|
OutputResolution outputResolution = new(height, 0, width);
|
||||||
areaPermyriad = IMapping.GetAreaPermyriad(faceAreaPermyriad, location, outputResolution);
|
areaPermyriad = IMapping.GetAreaPermyriad(faceAreaPermyriad, location, outputResolution);
|
||||||
Assert.IsTrue(areaPermyriad == 625);
|
Assert.IsTrue(areaPermyriad == 625);
|
||||||
|
@ -87,26 +87,21 @@ public class UnitTestResize
|
|||||||
string sourceFileName = "105131603001106320328.jpg";
|
string sourceFileName = "105131603001106320328.jpg";
|
||||||
string sourceDirectoryName = "Mike iCloud Have Date Taken 2022 !9";
|
string sourceDirectoryName = "Mike iCloud Have Date Taken 2022 !9";
|
||||||
Item item;
|
Item item;
|
||||||
bool reverse = false;
|
|
||||||
bool isArchive = false;
|
bool isArchive = false;
|
||||||
FileHolder resizedFileHolder;
|
FileHolder resizedFileHolder;
|
||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
List<string> parseExceptions = [];
|
List<string> parseExceptions = [];
|
||||||
|
string[] changesFrom = [nameof(A_Metadata)];
|
||||||
const bool isValidImageFormatExtension = true;
|
const bool isValidImageFormatExtension = true;
|
||||||
List<Tuple<string, DateTime>> subFileTuples = [];
|
List<Tuple<string, DateTime>> subFileTuples = [];
|
||||||
int length = _PropertyConfiguration.RootDirectory.Length;
|
int length = _PropertyConfiguration.RootDirectory.Length;
|
||||||
string[] changesFrom = [nameof(A_Property)];
|
|
||||||
string outputResolution = _Configuration.OutputResolutions[0];
|
string outputResolution = _Configuration.OutputResolutions[0];
|
||||||
|
string bResultsFullGroupDirectory = GetResultsFullGroupDirectories();
|
||||||
bool outputResolutionHasNumber = outputResolution.Any(char.IsNumber);
|
bool outputResolutionHasNumber = outputResolution.Any(char.IsNumber);
|
||||||
(string cResultsFullGroupDirectory, _, _) = GetResultsFullGroupDirectories(outputResolution);
|
(string cResultsFullGroupDirectory, _, _) = GetResultsFullGroupDirectories(outputResolution);
|
||||||
(string aResultsFullGroupDirectory, string bResultsFullGroupDirectory) = GetResultsFullGroupDirectories();
|
|
||||||
Shared.Models.Methods.IBlurHasher blurHasher = new BlurHash.Models.C2_BlurHasher(_PropertyConfiguration);
|
Shared.Models.Methods.IBlurHasher blurHasher = new BlurHash.Models.C2_BlurHasher(_PropertyConfiguration);
|
||||||
A_Property propertyLogic = GetPropertyLogic(reverse, aResultsFullGroupDirectory);
|
|
||||||
string aPropertySingletonDirectory = Path.Combine(aResultsFullGroupDirectory, "{}");
|
|
||||||
if (!Directory.Exists(aPropertySingletonDirectory))
|
|
||||||
_ = Directory.CreateDirectory(aPropertySingletonDirectory);
|
|
||||||
(ImageCodecInfo imageCodecInfo, EncoderParameters encoderParameters, string filenameExtension) = C_Resize.GetTuple(_Configuration.OutputExtension, _Configuration.OutputQuality);
|
(ImageCodecInfo imageCodecInfo, EncoderParameters encoderParameters, string filenameExtension) = C_Resize.GetTuple(_Configuration.OutputExtension, _Configuration.OutputQuality);
|
||||||
B_Metadata metadata = new(null, _PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, ticks, bResultsFullGroupDirectory);
|
A_Metadata metadata = new(null, _PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, ticks, bResultsFullGroupDirectory);
|
||||||
_ = metadata.ToString();
|
_ = metadata.ToString();
|
||||||
C_Resize resize = new(_PropertyConfiguration, _Configuration.ForceResizeLastWriteTimeToCreationTime, _Configuration.OverrideForResizeImages, _Configuration.PropertiesChangedForResize, _Configuration.ValidResolutions, imageCodecInfo, encoderParameters, filenameExtension);
|
C_Resize resize = new(_PropertyConfiguration, _Configuration.ForceResizeLastWriteTimeToCreationTime, _Configuration.OverrideForResizeImages, _Configuration.PropertiesChangedForResize, _Configuration.ValidResolutions, imageCodecInfo, encoderParameters, filenameExtension);
|
||||||
_ = resize.ToString();
|
_ = resize.ToString();
|
||||||
@ -119,8 +114,6 @@ public class UnitTestResize
|
|||||||
Assert.IsNotNull(filePath.Id);
|
Assert.IsNotNull(filePath.Id);
|
||||||
string relativePath = IPath.GetRelativePath(fileHolder.FullName, length);
|
string relativePath = IPath.GetRelativePath(fileHolder.FullName, length);
|
||||||
ExifDirectory? exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(filePath);
|
ExifDirectory? exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(filePath);
|
||||||
string propertyLogicSourceDirectory = Path.GetFullPath(Path.Combine(aPropertySingletonDirectory, sourceDirectoryName));
|
|
||||||
propertyLogic.SetAngleBracketCollection(aResultsFullGroupDirectory, propertyLogicSourceDirectory);
|
|
||||||
if (outputResolutionHasNumber)
|
if (outputResolutionHasNumber)
|
||||||
resize.SetAngleBracketCollection(cResultsFullGroupDirectory, sourceDirectory);
|
resize.SetAngleBracketCollection(cResultsFullGroupDirectory, sourceDirectory);
|
||||||
resize.Update(cResultsFullGroupDirectory);
|
resize.Update(cResultsFullGroupDirectory);
|
||||||
@ -144,23 +137,16 @@ public class UnitTestResize
|
|||||||
NonThrowTryCatch();
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
private (string, string) GetResultsFullGroupDirectories()
|
private string GetResultsFullGroupDirectories()
|
||||||
{
|
{
|
||||||
string aResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
string result = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
||||||
_PropertyConfiguration,
|
_Configuration.PropertyConfiguration,
|
||||||
nameof(A_Property),
|
nameof(A_Metadata),
|
||||||
string.Empty,
|
string.Empty,
|
||||||
includeResizeGroup: false,
|
includeResizeGroup: false,
|
||||||
includeModel: false,
|
includeModel: false,
|
||||||
includePredictorModel: false);
|
includePredictorModel: false);
|
||||||
string bResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
return new(result);
|
||||||
_PropertyConfiguration,
|
|
||||||
nameof(B_Metadata),
|
|
||||||
string.Empty,
|
|
||||||
includeResizeGroup: false,
|
|
||||||
includeModel: false,
|
|
||||||
includePredictorModel: false);
|
|
||||||
return new(aResultsFullGroupDirectory, bResultsFullGroupDirectory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private (string, string, string) GetResultsFullGroupDirectories(string outputResolution)
|
private (string, string, string) GetResultsFullGroupDirectories(string outputResolution)
|
||||||
|
@ -68,26 +68,21 @@ public class UnitTestFace
|
|||||||
string sourceFileName = "100000507001158650387.jpg";
|
string sourceFileName = "100000507001158650387.jpg";
|
||||||
string sourceDirectoryName = "Facebook/2023.2 Summer Facebook";
|
string sourceDirectoryName = "Facebook/2023.2 Summer Facebook";
|
||||||
Item item;
|
Item item;
|
||||||
bool reverse = false;
|
|
||||||
bool isArchive = false;
|
bool isArchive = false;
|
||||||
FileHolder resizedFileHolder;
|
FileHolder resizedFileHolder;
|
||||||
long ticks = DateTime.Now.Ticks;
|
long ticks = DateTime.Now.Ticks;
|
||||||
List<string> parseExceptions = [];
|
List<string> parseExceptions = [];
|
||||||
|
string[] changesFrom = [nameof(A_Metadata)];
|
||||||
const bool isValidImageFormatExtension = true;
|
const bool isValidImageFormatExtension = true;
|
||||||
List<Tuple<string, DateTime>> subFileTuples = [];
|
List<Tuple<string, DateTime>> subFileTuples = [];
|
||||||
int length = _PropertyConfiguration.RootDirectory.Length;
|
int length = _PropertyConfiguration.RootDirectory.Length;
|
||||||
string[] changesFrom = [nameof(A_Property)];
|
|
||||||
string outputResolution = _Configuration.OutputResolutions[0];
|
string outputResolution = _Configuration.OutputResolutions[0];
|
||||||
|
string bResultsFullGroupDirectory = GetResultsFullGroupDirectories();
|
||||||
bool outputResolutionHasNumber = outputResolution.Any(char.IsNumber);
|
bool outputResolutionHasNumber = outputResolution.Any(char.IsNumber);
|
||||||
(string cResultsFullGroupDirectory, _, _) = GetResultsFullGroupDirectories(outputResolution);
|
(string cResultsFullGroupDirectory, _, _) = GetResultsFullGroupDirectories(outputResolution);
|
||||||
(string aResultsFullGroupDirectory, string bResultsFullGroupDirectory) = GetResultsFullGroupDirectories();
|
|
||||||
Shared.Models.Methods.IBlurHasher blurHasher = new BlurHash.Models.C2_BlurHasher(_PropertyConfiguration);
|
Shared.Models.Methods.IBlurHasher blurHasher = new BlurHash.Models.C2_BlurHasher(_PropertyConfiguration);
|
||||||
A_Property propertyLogic = GetPropertyLogic(reverse, aResultsFullGroupDirectory);
|
|
||||||
string aPropertySingletonDirectory = Path.Combine(aResultsFullGroupDirectory, "{}");
|
|
||||||
if (!Directory.Exists(aPropertySingletonDirectory))
|
|
||||||
_ = Directory.CreateDirectory(aPropertySingletonDirectory);
|
|
||||||
(ImageCodecInfo imageCodecInfo, EncoderParameters encoderParameters, string filenameExtension) = C_Resize.GetTuple(_Configuration.OutputExtension, _Configuration.OutputQuality);
|
(ImageCodecInfo imageCodecInfo, EncoderParameters encoderParameters, string filenameExtension) = C_Resize.GetTuple(_Configuration.OutputExtension, _Configuration.OutputQuality);
|
||||||
B_Metadata metadata = new(null, _PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, ticks, bResultsFullGroupDirectory);
|
A_Metadata metadata = new(null, _PropertyConfiguration, _Configuration.ForceMetadataLastWriteTimeToCreationTime, _Configuration.PropertiesChangedForMetadata, ticks, bResultsFullGroupDirectory);
|
||||||
_ = metadata.ToString();
|
_ = metadata.ToString();
|
||||||
C_Resize resize = new(_PropertyConfiguration, _Configuration.ForceResizeLastWriteTimeToCreationTime, _Configuration.OverrideForResizeImages, _Configuration.PropertiesChangedForResize, _Configuration.ValidResolutions, imageCodecInfo, encoderParameters, filenameExtension);
|
C_Resize resize = new(_PropertyConfiguration, _Configuration.ForceResizeLastWriteTimeToCreationTime, _Configuration.OverrideForResizeImages, _Configuration.PropertiesChangedForResize, _Configuration.ValidResolutions, imageCodecInfo, encoderParameters, filenameExtension);
|
||||||
_ = resize.ToString();
|
_ = resize.ToString();
|
||||||
@ -100,8 +95,6 @@ public class UnitTestFace
|
|||||||
Assert.IsNotNull(filePath.Id);
|
Assert.IsNotNull(filePath.Id);
|
||||||
string relativePath = IPath.GetRelativePath(fileHolder.FullName, length);
|
string relativePath = IPath.GetRelativePath(fileHolder.FullName, length);
|
||||||
ExifDirectory? exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(filePath);
|
ExifDirectory? exifDirectory = Metadata.Models.Stateless.Methods.IMetadata.GetExifDirectory(filePath);
|
||||||
string propertyLogicSourceDirectory = Path.GetFullPath(Path.Combine(aPropertySingletonDirectory, sourceDirectoryName));
|
|
||||||
propertyLogic.SetAngleBracketCollection(aResultsFullGroupDirectory, propertyLogicSourceDirectory);
|
|
||||||
if (outputResolutionHasNumber)
|
if (outputResolutionHasNumber)
|
||||||
resize.SetAngleBracketCollection(cResultsFullGroupDirectory, sourceDirectory);
|
resize.SetAngleBracketCollection(cResultsFullGroupDirectory, sourceDirectory);
|
||||||
resize.Update(cResultsFullGroupDirectory);
|
resize.Update(cResultsFullGroupDirectory);
|
||||||
@ -134,23 +127,16 @@ public class UnitTestFace
|
|||||||
NonThrowTryCatch();
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
private (string, string) GetResultsFullGroupDirectories()
|
private string GetResultsFullGroupDirectories()
|
||||||
{
|
{
|
||||||
string aResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
string result = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
||||||
_PropertyConfiguration,
|
_Configuration.PropertyConfiguration,
|
||||||
nameof(A_Property),
|
nameof(A_Metadata),
|
||||||
string.Empty,
|
string.Empty,
|
||||||
includeResizeGroup: false,
|
includeResizeGroup: false,
|
||||||
includeModel: false,
|
includeModel: false,
|
||||||
includePredictorModel: false);
|
includePredictorModel: false);
|
||||||
string bResultsFullGroupDirectory = Property.Models.Stateless.IResult.GetResultsFullGroupDirectory(
|
return new(result);
|
||||||
_PropertyConfiguration,
|
|
||||||
nameof(B_Metadata),
|
|
||||||
string.Empty,
|
|
||||||
includeResizeGroup: false,
|
|
||||||
includeModel: false,
|
|
||||||
includePredictorModel: false);
|
|
||||||
return new(aResultsFullGroupDirectory, bResultsFullGroupDirectory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private (string, string, string) GetResultsFullGroupDirectories(string outputResolution)
|
private (string, string, string) GetResultsFullGroupDirectories(string outputResolution)
|
||||||
|
Reference in New Issue
Block a user