feat(10-01): create BrandingService with magic byte validation and auto-compression

- Add IBrandingService interface with ImportLogoAsync, Save/Clear/GetMspLogoAsync
- Add BrandingService: PNG/JPEG magic byte detection, rejects unsupported formats with
  descriptive error, auto-compresses files over 512 KB using WPF PresentationCore imaging
- Add BrandingServiceTests: 9 tests covering validation, rejection, compression, CRUD
- Deviation: used WPF BitmapEncoder/TransformedBitmap instead of System.Drawing.Bitmap
  (System.Drawing.Common not available without new NuGet package; WPF PresentationCore
  is in the existing stack per architectural decisions)
This commit is contained in:
Dev
2026-04-08 12:32:23 +02:00
parent 3ba574612f
commit 130386622f
3 changed files with 386 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
using SharepointToolbox.Core.Models;
namespace SharepointToolbox.Services;
public interface IBrandingService
{
Task<LogoData> ImportLogoAsync(string filePath);
Task SaveMspLogoAsync(LogoData logo);
Task ClearMspLogoAsync();
Task<LogoData?> GetMspLogoAsync();
}