Skip to content

fix(image): let every picture reader cancel an XCF merge - #1485

Open
Ugoyo wants to merge 1 commit into
KnifeLemon:mainfrom
Ugoyo:claude/xcf-layers
Open

Ugoyo wants to merge 1 commit into
KnifeLemon:mainfrom
Ugoyo:claude/xcf-layers

Conversation

@Ugoyo

@Ugoyo Ugoyo commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

What does this change?

Follow-up to #1440, from the review: the row-by-row cancellation of a GIMP merge only reached the ImageMagick converter. ImageReader.Read now takes an optional CancellationToken and passes it to Xcf.ReadFlattened, and every engine that reads pictures passes its job's token: PDF (PdfSharp), HEIC, ICNS, upscaling, tracing, image → 3D and Merge images. The converter's own XCF special case is gone; it uses the same path. Pandoc's EMF/WMF pass and the Hide preview read no XCF and have no token, so they keep the default.

Type of change

  • Bug fix
  • New feature or improvement
  • New format or engine
  • Translation
  • Documentation
  • Build, CI or dependencies

How was it tested?

  • dotnet format --verify-no-changes: the new optional parameter made xUnit1051 flag one existing call in UpscalerTests, which now passes TestContext.Current.CancellationToken
  • dotnet test: the XCF, PDN, join, ICNS, upscale, HEIC, tracing, 3D and PdfSharp tests pass; Merging_can_be_cancelled now also cancels through ImageReader.Read. The one failure (MediaTests…qta…, FFmpeg) also fails without this change in my container.
  • Tried it in the app (what you converted or clicked, and on which OS):

Screenshots (UI changes)

None.

Checklist

  • New UI strings are in all src/Filee.App/Assets/i18n/*.json files (none added)
  • New third-party code or binaries are listed in THIRD-PARTY-NOTICES.md (none)
  • The PR does one thing (unrelated changes go in a separate PR)

🤖 Generated with Claude Code

Follow-up to KnifeLemon#1440. ImageReader.Read takes an optional CancellationToken and
passes it to Xcf.ReadFlattened, so the row-by-row cancellation of a GIMP
merge reaches every engine that reads pictures, not only the ImageMagick
converter: PDF (PdfSharp), HEIC, ICNS, upscaling, tracing, 3D and Merge
images now pass their job's token. The converter's own XCF special case is
gone. Pandoc's metafile pass and the Hide preview read no XCF and have no
token; they keep the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPxh5sKTbvUBdxgCJJnzxZ
@Ugoyo
Ugoyo requested a review from KnifeLemon as a code owner November 13, 2026 18:49
@github-actions github-actions Bot added the bug Something isn't working label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant