Race time fix
This commit is contained in:
parent
fa889a5cd3
commit
abdd2a313a
2 changed files with 15 additions and 16 deletions
|
|
@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -66,9 +67,7 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger<ImageCreatorShar
|
|||
catch (Exception ex)
|
||||
{
|
||||
var e = ex.Demystify();
|
||||
Console.WriteLine(e);
|
||||
Console.WriteLine(e.Message);
|
||||
Console.WriteLine(e.StackTrace);
|
||||
logger.LogError(e, "Error in processing photo {WorkFileName}", imgState.WorkFile.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88,10 +87,10 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger<ImageCreatorShar
|
|||
}
|
||||
|
||||
IExifValue<string> date = null;
|
||||
var creationFound = img.Metadata?.ExifProfile?.TryGetValue(ExifTag.DateTime, out date) ?? false;
|
||||
var creationFound = img.Metadata?.ExifProfile?.TryGetValue(ExifTag.DateTimeOriginal, out date) ?? false;
|
||||
if (creationFound)
|
||||
{
|
||||
var succ = DateTime.TryParse(date.ToString(), out var crDate);
|
||||
var succ = DateTime.TryParseExact(date.Value, "yyyy:MM:dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out var crDate);
|
||||
if (succ)
|
||||
{
|
||||
imgState.CreationDate = crDate;
|
||||
|
|
@ -169,12 +168,12 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger<ImageCreatorShar
|
|||
}
|
||||
|
||||
if (picSettings.UsaTempoGaraTestoApplicare != true) return;
|
||||
var diff = imgState.DataPartenzaI - imgState.DataFoto;
|
||||
var diffA = diff.TotalSeconds * 10000000;
|
||||
|
||||
var orario = new TimeSpan(0, 0, 0, (int)diffA);
|
||||
imgState.TestoFirma += $" {imgState.TestoOrario}{orario.Hours:00}:{orario.Minutes:00}:{orario.Seconds:00}";
|
||||
imgState.TestoFirmaV += $" {imgState.TestoOrario}{orario.Hours:00}:{orario.Minutes:00}:{orario.Seconds:00}";
|
||||
var diff = imgState.DataFoto - imgState.DataPartenzaI;
|
||||
//var diffA = diff.TotalSeconds * 10000000;
|
||||
|
||||
// var orario = new TimeSpan(0, Math.Abs(diff.Hours), Math.Abs(diff.Minutes), (int)diffA);
|
||||
imgState.TestoFirma += $" {imgState.TestoOrario}{diff.Hours:00}:{diff.Minutes:00}:{diff.Seconds:00}";
|
||||
imgState.TestoFirmaV += $" {imgState.TestoOrario}{diff.Hours:00}:{diff.Minutes:00}:{diff.Seconds:00}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -447,7 +446,7 @@ public class ImageCreatorSharp(PicSettings picSettings, ILogger<ImageCreatorShar
|
|||
|
||||
if (crSize.Width > System.Convert.ToSingle(g.Width))
|
||||
{
|
||||
int conta = imgState.DimensioneStandard;
|
||||
var conta = imgState.DimensioneStandard;
|
||||
do
|
||||
{
|
||||
if (conta > 20)
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AssemblyVersion>3.0.1.0</AssemblyVersion>
|
||||
<FileVersion>3.0.1.0</FileVersion>
|
||||
<InformationalVersion>3.0.0-alpha.63+Branch.develop.Sha.39a9baf5c618d8d79c75b89e2d5c4020939697f2</InformationalVersion>
|
||||
<Version>3.0.1-alpha0063</Version>
|
||||
<AssemblyVersion>3.1.1.0</AssemblyVersion>
|
||||
<FileVersion>3.1.1.0</FileVersion>
|
||||
<InformationalVersion>3.1.1</InformationalVersion>
|
||||
<Version>3.1.1</Version>
|
||||
<AssemblyName>ImageCatalog2025</AssemblyName>
|
||||
<LangVersion>default</LangVersion>
|
||||
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue