Implement ImageCreatorImageSharp using SixLabors.ImageSharp for image processing
- Added ImageCreatorImageSharp class for image creation, handling EXIF orientation, resizing, and saving images. - Replaced GDI+ dependencies with ImageSharp for cross-platform compatibility. - Introduced methods for drawing text and logos on images, including handling transparency and positioning. - Created a test plan for validating ImageCreatorImageSharp functionality, focusing on image resizing, text positioning, logo features, and EXIF orientation. - Added documentation for the test plan outlining goals, project structure, and implementation notes.
This commit is contained in:
parent
90fb03bf0c
commit
d62342aae1
11 changed files with 455 additions and 74 deletions
44
MaddoShared.ImageSharpTests/Helpers/CreatorFactory.cs
Normal file
44
MaddoShared.ImageSharpTests/Helpers/CreatorFactory.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System.IO;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
|
||||
namespace MaddoShared.ImageSharpTests.Helpers
|
||||
{
|
||||
public static class CreatorFactory
|
||||
{
|
||||
public static MaddoShared.PicSettings CreateDefaultPicSettings()
|
||||
{
|
||||
return new MaddoShared.PicSettings
|
||||
{
|
||||
DimStandard = 48,
|
||||
DimStandardMiniatura = 12,
|
||||
LarghezzaSmall = 150,
|
||||
AltezzaSmall = 150,
|
||||
LarghezzaBig = 800,
|
||||
AltezzaBig = 600,
|
||||
Trasparenza = 0,
|
||||
IlFont = "Arial",
|
||||
Grassetto = false,
|
||||
Posizione = "CENTRO",
|
||||
Allineamento = "CENTRO",
|
||||
Margine = 10,
|
||||
MargVert = 10,
|
||||
TestoMin = false,
|
||||
AggNumTempMin = false,
|
||||
CreaMiniature = false,
|
||||
LogoAggiungi = false,
|
||||
LogoAltezza = 100,
|
||||
LogoLarghezza = 100,
|
||||
LogoMargine = "0",
|
||||
JpegQuality = 90,
|
||||
JpegQualityMin = 75,
|
||||
};
|
||||
}
|
||||
|
||||
public static MaddoShared.ImageCreatorImageSharp CreateImageCreator(MaddoShared.PicSettings settings)
|
||||
{
|
||||
var logger = NullLogger<MaddoShared.ImageCreatorImageSharp>.Instance;
|
||||
return new MaddoShared.ImageCreatorImageSharp(settings, logger);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue