Refactored image creator code
This commit is contained in:
parent
2fde30572b
commit
fa889a5cd3
5 changed files with 482 additions and 585 deletions
|
|
@ -13,7 +13,7 @@ using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace MaddoShared
|
namespace MaddoShared
|
||||||
{
|
{
|
||||||
public class ImageCreationStuff(ILogger<ImageCreationStuff> logger, PicSettings picSettings)
|
public class ImageCreationStuff(ILogger<ImageCreationStuff> logger, PicSettings picSettings, ImageCreatorSharp imageCreatorService)
|
||||||
{
|
{
|
||||||
public class Options
|
public class Options
|
||||||
{
|
{
|
||||||
|
|
@ -72,8 +72,16 @@ namespace MaddoShared
|
||||||
using var logoCopy = logoBmp.Clone(new Rectangle(0, 0, logoBmp.Width, logoBmp.Height),
|
using var logoCopy = logoBmp.Clone(new Rectangle(0, 0, logoBmp.Width, logoBmp.Height),
|
||||||
logoBmp.PixelFormat);
|
logoBmp.PixelFormat);
|
||||||
|
|
||||||
using var imgCreator = new ImageCreatorSharp(fileData.File, fileData.Directory, picSettings);
|
var imgState = new ImageState
|
||||||
await imgCreator.CreaImmagineThread(fileData.File.Name, logoCopy);
|
{
|
||||||
|
WorkFile = fileData.File,
|
||||||
|
DestDir = fileData.Directory,
|
||||||
|
};
|
||||||
|
|
||||||
|
await imageCreatorService.CreaImmagineThread(imgState, logoCopy);
|
||||||
|
|
||||||
|
// using var imgCreator = new ImageCreatorSharp(fileData.File, fileData.Directory, picSettings);
|
||||||
|
// await imgCreator.CreaImmagineThread(fileData.File.Name, logoCopy);
|
||||||
|
|
||||||
results.Add(fileData.File.Name);
|
results.Add(fileData.File.Name);
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
45
MaddoShared/ImageState.cs
Normal file
45
MaddoShared/ImageState.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace MaddoShared;
|
||||||
|
|
||||||
|
public class ImageState
|
||||||
|
{
|
||||||
|
public bool FotoRuotaADestra { get; set; } = false;
|
||||||
|
public bool FotoRuotaASinistra { get; set; } = false;
|
||||||
|
|
||||||
|
public string TempMinText { get; set; } = "";
|
||||||
|
// public crFont1 As Font
|
||||||
|
public string NomeFileChild { get; set; }
|
||||||
|
|
||||||
|
public DirectoryInfo SourceDir { get; set; }
|
||||||
|
public DirectoryInfo DestDirStart { get; set; }
|
||||||
|
public DirectoryInfo DestDir { get; set; }
|
||||||
|
|
||||||
|
public FileInfo WorkFile { get; set; }
|
||||||
|
|
||||||
|
public string TestoFirma { get; set; }
|
||||||
|
public string TestoFirmaV { get; set; }
|
||||||
|
public int AlphaScelta { get; set; }
|
||||||
|
public int DimensioneStandard { get; set; }
|
||||||
|
public int DimensioneStandardMiniatura { get; set; }
|
||||||
|
public DateTime DataFoto { get; set; }
|
||||||
|
public DateTime DataPartenzaI { get; set; }
|
||||||
|
public string TestoOrario { get; set; }
|
||||||
|
public string TestoFirmaPiccola { get; set; }
|
||||||
|
public Size ThumbSizeSmall { get; set; }
|
||||||
|
public Size ThumbSizeBig { get; set; }
|
||||||
|
public string NomeFileSmall{ get; set; }
|
||||||
|
public string NomeFileBig{ get; set; }
|
||||||
|
public string NomeFileBig2{ get; set; }
|
||||||
|
|
||||||
|
public float YPosFromBottom{ get; set; }
|
||||||
|
public float YPosFromBottom1{ get; set; }
|
||||||
|
public float YPosFromBottom2{ get; set; }
|
||||||
|
public float YPosFromBottom3{ get; set; }
|
||||||
|
public float YPosFromBottom4{ get; set; }
|
||||||
|
|
||||||
|
public Orientations Orientation{ get; set; }
|
||||||
|
public DateTime? CreationDate{ get; set; }
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AsyncEnumerator" Version="4.0.2" />
|
<PackageReference Include="AsyncEnumerator" Version="4.0.2" />
|
||||||
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
||||||
|
<PackageReference Include="IDisposableAnalyzers" Version="4.0.8">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.7" />
|
||||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.7" />
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ namespace ImageCatalog_2
|
||||||
services.AddTransient<DataModel>();
|
services.AddTransient<DataModel>();
|
||||||
|
|
||||||
services.AddTransient<ImageCreationStuff>();
|
services.AddTransient<ImageCreationStuff>();
|
||||||
|
services.AddTransient<ImageCreatorSharp>();
|
||||||
|
|
||||||
services.AddSingleton<ParametriSetup>();
|
services.AddSingleton<ParametriSetup>();
|
||||||
services.AddSingleton<PicSettings>();
|
services.AddSingleton<PicSettings>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue