This commit is contained in:
2023-10-15 09:51:56 -07:00
parent 2cd2c2b434
commit cd5ab223c9
75 changed files with 895 additions and 722 deletions

View File

@ -214,10 +214,10 @@ internal class Property
DateTime?[] dateTimes;
string dateTimeFormat;
DateTime checkDateTime;
int? orientation = null;
DateTime? dateTime = null;
string[]? keywords = null;
PropertyItem? propertyItem;
string? orientation = null;
DateTime? gpsDateStamp = null;
List<DateTime> dateTimesByLogic;
DateTime? dateTimeOriginal = null;
@ -312,28 +312,19 @@ internal class Property
{
propertyItem = image.GetPropertyItem((int)IExif.Tags.Make);
if (propertyItem?.Value is not null)
{
value = asciiEncoding.GetString(propertyItem.Value, 0, propertyItem.Len - 1);
make = value;
}
make = asciiEncoding.GetString(propertyItem.Value, 0, propertyItem.Len - 1);
}
if (image.PropertyIdList.Contains((int)IExif.Tags.Model))
{
propertyItem = image.GetPropertyItem((int)IExif.Tags.Model);
if (propertyItem?.Value is not null)
{
value = asciiEncoding.GetString(propertyItem.Value, 0, propertyItem.Len - 1);
model = value;
}
model = asciiEncoding.GetString(propertyItem.Value, 0, propertyItem.Len - 1);
}
if (image.PropertyIdList.Contains((int)IExif.Tags.Orientation))
{
propertyItem = image.GetPropertyItem((int)IExif.Tags.Orientation);
if (propertyItem?.Value is not null)
{
value = BitConverter.ToInt16(propertyItem.Value, 0).ToString();
orientation = value;
}
orientation = BitConverter.ToInt16(propertyItem.Value, 0);
}
if (image.PropertyIdList.Contains((int)IExif.Tags.XPKeywords))
{
@ -381,9 +372,9 @@ internal class Property
if (fileHolder.LastWriteTime is null && property?.LastWriteTime is null)
throw new NullReferenceException(nameof(fileHolder.LastWriteTime));
if (fileHolder.CreationTime is not null && fileHolder.LastWriteTime is not null)
result = new(fileHolder.CreationTime.Value, dateTime, dateTimeDigitized, dateTimeFromName, dateTimeOriginalByLogic, fileLength, gpsDateStamp, height, id, keywords, fileHolder.LastWriteTime.Value, make, model, orientation, width);
result = new(fileHolder.CreationTime.Value, dateTime, dateTimeDigitized, dateTimeFromName, dateTimeOriginalByLogic, fileLength, gpsDateStamp, height, id, keywords, fileHolder.LastWriteTime.Value, make, model, orientation?.ToString(), width);
else if (property is not null)
result = new(property.CreationTime, dateTime, dateTimeDigitized, dateTimeFromName, dateTimeOriginalByLogic, fileLength, gpsDateStamp, height, id, keywords, property.LastWriteTime, make, model, orientation, width);
result = new(property.CreationTime, dateTime, dateTimeDigitized, dateTimeFromName, dateTimeOriginalByLogic, fileLength, gpsDateStamp, height, id, keywords, property.LastWriteTime, make, model, orientation?.ToString(), width);
else
throw new NullReferenceException(nameof(property));
return (message, dateTimesByLogic.ToArray(), result);