Fixed compilation and added libraries
This commit is contained in:
parent
2822038123
commit
0d8ab38efd
8 changed files with 66 additions and 38 deletions
|
|
@ -5,7 +5,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using NLog;
|
||||
using MaddoLibrary.Base.Log;
|
||||
using SixLabors.Fonts;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Drawing;
|
||||
|
|
@ -29,11 +29,13 @@ namespace CatalogLib
|
|||
|
||||
using (Image<Rgba32> image = Image.Load(workFile.FullName)/* new Image(workFile.FullName)*/)
|
||||
{
|
||||
MaddoLogger.Log("Loaded Image: {0}", workFile.FullName);
|
||||
//image.Rotate(-90);
|
||||
|
||||
if (PicSettings.Instance.GeneraleRotazioneAutomatica)
|
||||
{
|
||||
image.Mutate(img => img.AutoOrient());
|
||||
MaddoLogger.Log("Rotated Image: {0}", workFile.FullName);
|
||||
//image.AutoOrient();
|
||||
|
||||
//var exif = image.MetaData.ExifProfile;
|
||||
|
|
@ -98,12 +100,13 @@ namespace CatalogLib
|
|||
if (PicSettings.Instance.EnableText)
|
||||
{
|
||||
SetExtraText(image);
|
||||
MaddoLogger.Log("Drawn text on Image: {0}", workFile.FullName);
|
||||
}
|
||||
|
||||
//JpegDecoder j = new JpegDecoder();
|
||||
var va = Vector.IsHardwareAccelerated;
|
||||
Debug.WriteLine($"Hardware Accelerated: {va}");
|
||||
|
||||
|
||||
MaddoLogger.Log("Hardware Accelerated: {0}", va);
|
||||
//image.Resize(PicSettings.Instance.FotoLarghezza, PicSettings.Instance.FotoAltezza);
|
||||
|
||||
//image.Resize(2240, 2240);
|
||||
|
|
@ -112,6 +115,8 @@ namespace CatalogLib
|
|||
//image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200));
|
||||
image.Save(Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name));
|
||||
//image.Resize(200, 200).Save("");
|
||||
|
||||
MaddoLogger.Log("Saved Image: {0} to: {1}", workFile.FullName, Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -151,8 +156,8 @@ namespace CatalogLib
|
|||
float scalingFactor = Math.Min(image.Width / size.Width, image.Height / size.Height);
|
||||
Font scaledFont = new Font(font, scalingFactor * font.Size);
|
||||
|
||||
|
||||
image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
|
||||
image.Mutate(x => x.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom }));
|
||||
//image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -166,7 +171,7 @@ namespace CatalogLib
|
|||
var size = TextMeasurer.Measure("Test test test test test", new RendererOptions(font));
|
||||
float scalingFactor = Math.Min(image.Width / size.Width, image.Height / size.Height);
|
||||
Font scaledFont = new Font(font, scalingFactor * font.Size);
|
||||
image.DrawText("Test test test test test", scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
|
||||
image.Mutate(x => x.DrawText("Test test test test test", scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom }));
|
||||
}
|
||||
|
||||
private string FlipRgbString(string originalString)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue