- 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.
33 lines
933 B
C#
33 lines
933 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace MaddoShared.ImageSharpTests.Helpers
|
|
{
|
|
public sealed class TempWorkspace : IDisposable
|
|
{
|
|
public DirectoryInfo Root { get; }
|
|
public DirectoryInfo SourceDir { get; }
|
|
public DirectoryInfo DestDir { get; }
|
|
|
|
public TempWorkspace()
|
|
{
|
|
var root = Path.Combine(Path.GetTempPath(), "MaddoShared.ImageSharpTests", Guid.NewGuid().ToString("N"));
|
|
Root = Directory.CreateDirectory(root);
|
|
SourceDir = Directory.CreateDirectory(Path.Combine(Root.FullName, "Source"));
|
|
DestDir = Directory.CreateDirectory(Path.Combine(Root.FullName, "Dest"));
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
try
|
|
{
|
|
if (Root.Exists)
|
|
Root.Delete(true);
|
|
}
|
|
catch
|
|
{
|
|
// best-effort cleanup
|
|
}
|
|
}
|
|
}
|
|
}
|