Skip to content

Replace SixLabors.ImageSharp: 4.x requires a commercial license #181

Closed

Description

@0Keith

Decision

ImageSharp 4.x (Dependabot #174, #176) fails the build with No Six Labors license found - the 4.x line requires a paid Six Labors license key at build time. The Captain declined the upgrade on 2026-09-26: PaperNexus stays on ImageSharp 3.1.12 + ImageSharp.Drawing 2.1.7 and a replacement imaging library is to be found. The 3.x line is under the Six Labors Split License, which grants Apache 2.0 terms to open-source consumers, so PaperNexus's current use is covered; the replacement removes the dead-end dependency.

Replacement chosen (2026-09-26): SkiaSharp (MIT). It is already in the build as Avalonia's renderer, so its native libraries already ship in both binaries.

Scope

Evaluate and adopt a replacement for the SixLabors stack. Current usage sites:

  • SwitchWallpaper.cs - resize/fill, title overlay text rendering with outline (ImageSharp.Drawing + bundled Cinzel font), PNG/JPEG encode with the 16 MB fallback
  • DownloadWallpapers.cs - decode and resolution handling
  • App.axaml.cs - programmatically drawn tray menu icons
  • Core/BundledFonts.cs - font loading for annotation
  • Core/Platform/DesktopEntry.cs - hicolor icon write
  • Core/WallpaperNexusSettings.cs, ViewModels/GalleryItem.cs, ViewModels/WallpaperConfigViewModel.cs - thumbnails / colour types

Also

Add a Dependabot ignore rule for SixLabors.ImageSharp* major versions in .github/dependabot.yml so the 4.x bump stops reopening until the replacement lands. Done in #183.

Activity

  1. self-assigned this
    on Sep 27, 2026
  2. added
    dependenciesPull requests that update a dependency file
    .NETPull requests that update .NET code
    on Sep 27, 2026
  3. 0Keith commented on Sep 27, 2026

    @0Keith
    CollaboratorAuthor

    Migration plan: SixLabors → SkiaSharp

    Open decision: where the SkiaSharp code lives (Captain's call)

    • A. Keep all SkiaSharp code in Core/Imaging/ (recommended). One place holds every image operation: resize-to-fit, gallery thumbnail, icon load and resize, wallpaper annotation, PNG encoding with the JPEG fallback, and drawing the tray icons. No other file references SkiaSharp. This mirrors the existing Core/Platform/ rule. This issue exists because an imaging library leaked into eight files, so a future swap would then touch only this folder.
    • B. Replace ImageSharp in place in each file. The same eight files change, and SkiaSharp calls stay scattered the way ImageSharp's are today.

    Package

    • Add a direct reference to SkiaSharp at the version Avalonia 12.1.1 already resolves (3.119.4, MIT licensed). The native libraries already ship in both published binaries because Avalonia renders with Skia.
    • Remove SixLabors.ImageSharp and SixLabors.ImageSharp.Drawing from both project files, and remove the Dependabot ignore rule added in chore(deps): stop Dependabot proposing ImageSharp major versions #183.

    Changes per usage site

    File Today After
    SwitchWallpaper.cs load, annotate with outlined title and timestamp, PNG encode then JPEG quality fallback over 16 MB calls the imaging layer; the outline is still a stroke pass then a fill pass, width fontSize/12 with a 1px floor; the 16 MB fallback logic is unchanged
    DownloadWallpapers.cs resize to fit the resolution cap, re-encode JPEG 95 or 8-bit RGB PNG same behaviour through the imaging layer
    ViewModels/GalleryItem.cs 600px-wide PNG thumbnail same
    App.axaml.cs 32px app icon, four 16px tray icons drawn as shapes same shapes drawn on a Skia canvas
    Core/Platform/DesktopEntry.cs resize the hicolor icon same
    Core/BundledFonts.cs bundled Cinzel collection, system font lookup Skia typeface loaded from the bundled font stream, system fonts through Skia's font manager
    ViewModels/WallpaperConfigViewModel.cs font picker lists system families lists Skia's installed families; still never a hardcoded list
    Core/WallpaperNexusSettings.cs empty font-family guard, comment names SixLabors guard kept, comment updated

    Tests

    • The test helpers build their fixture images with SkiaSharp, and the dimension checks read images through SkiaSharp.
    • The font-picker test compares against Skia's installed families.
    • New tests for the imaging layer: resize-to-fit output size, thumbnail width, the JPEG fallback when the PNG exceeds the limit, and annotation that changes pixels only in the expected corner. Everything runs in memory, with no OS calls.

    Verification

    • Release build and the full test suite.
    • Run the app with --debug on the GNOME dev VM. Switch wallpaper with annotation on, then open current.png and look at the title, outline and position. Confirm the desktop shows it through gsettings. Screenshot the tray menu icons and check the hicolor icon file.
    • Gap: there is no Windows machine to run on, so on Windows only the published win-x64 build is verified, not how the app runs.

    Docs

    CLAUDE.md Dependencies and Wallpaper Processing sections, and the Core/Imaging/ folder in the structure tree if A is chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NETPull requests that update .NET codedependenciesPull requests that update a dependency file

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions