Skip to content

Update Magick.NET-Q8-AnyCPU from 13.5.0 to 14.10.4#34455

Merged
mattleibow merged 7 commits intomainfrom
copilot/update-magick-net-dependency
Mar 18, 2026
Merged

Update Magick.NET-Q8-AnyCPU from 13.5.0 to 14.10.4#34455
mattleibow merged 7 commits intomainfrom
copilot/update-magick-net-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Updates the Magick.NET-Q8-AnyCPU NuGet package from 13.5.0 to 14.10.4 and fixes all breaking API changes introduced in the major version bump.

Changes

Package Update

  • Magick.NET-Q8-AnyCPU 13.5.0 → 14.10.4 in VisualTestUtils.MagickNet.csproj

Breaking API Fixes

File Change Reason
MagickNetImageEditor.cs RePage()ResetPage() Method renamed in v14
MagickNetImageEditor.cs Cast Width/Height to int Changed from int to uint in v14
MagickNetVisualComparer.cs Cast Width/Height to int Changed from int to uint in v14
MagickNetVisualDiffGenerator.cs Updated Compare() call signature Return type changed to IMagickImage<byte> in v14
MagickNetImageEditor.cs MagickGeometry constructor takes uint Width/Height params changed to uint in v14
UITest.cs MagickImage constructor takes uint Width/Height params changed to uint in v14
UITest.cs Added using ImageMagick.Drawing; Drawables class moved from ImageMagick to ImageMagick.Drawing namespace in v14

Copilot AI and others added 2 commits March 12, 2026 14:52
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Member

/azp run maui-pr-uitests, maui-pr-devicetests

PureWeen
PureWeen previously approved these changes Mar 12, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34455

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34455"

…Magick.NET v14

Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
@mattleibow
Copy link
Copy Markdown
Member

/azp run maui-pr-devicetests

@mattleibow
Copy link
Copy Markdown
Member

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

…s class

In Magick.NET v14, the Drawables class moved from ImageMagick to
ImageMagick.Drawing namespace, causing CS0246 build error at UITest.cs
line 673.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow
Copy link
Copy Markdown
Member

/azp run maui-pr

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ImageMagick (Magick.NET) dependency used by MAUI’s visual test utilities and adjusts call sites to match updated Magick.NET APIs/types, primarily around image comparison and geometry/size handling.

Changes:

  • Bump Magick.NET-Q8-AnyCPU from 13.5.0 to 14.10.4 in the Magick-based visual test utility project.
  • Update Magick.NET API usages for image diff generation and cropping/page reset behavior.
  • Adjust width/height handling to match updated Magick.NET uint-based APIs (casts added in comparer/editor and Mac UI test screenshot masking).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj Updates Magick.NET package version to a newer major release.
src/TestUtils/src/VisualTestUtils.MagickNet/MagickNetVisualDiffGenerator.cs Switches to newer Compare(..., out ...) overload to generate diff image.
src/TestUtils/src/VisualTestUtils.MagickNet/MagickNetVisualComparer.cs Adapts size comparison to updated Magick.NET width/height types via casts.
src/TestUtils/src/VisualTestUtils.MagickNet/MagickNetImageEditor.cs Updates crop geometry construction and replaces RePage() with ResetPage(), plus size casts.
src/Controls/tests/TestCases.Shared.Tests/UITest.cs Updates Magick image construction to use uint dimensions and adds required namespace import.

- Add using var to MagickImage instances in MagickNetVisualDiffGenerator
  and MagickNetVisualComparer to prevent unmanaged memory leaks
- Add ArgumentOutOfRangeException guards before uint casts in
  MagickNetImageEditor.Crop for negative width/height
- Add early return guard in UITest.TakeScreenshot for invalid window
  bounds before uint cast

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow mattleibow force-pushed the copilot/update-magick-net-dependency branch from 455b3c3 to 110564f Compare March 17, 2026 20:16
@mattleibow
Copy link
Copy Markdown
Member

mattleibow commented Mar 17, 2026

/azp run maui-pr-devicetests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow mattleibow marked this pull request as ready for review March 17, 2026 20:24
@mattleibow
Copy link
Copy Markdown
Member

mattleibow commented Mar 17, 2026

/azp run maui-pr-devicetests

@mattleibow
Copy link
Copy Markdown
Member

mattleibow commented Mar 17, 2026

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

In Magick.NET v14, ErrorMetric.Fuzz changed its calculation and now
reports much higher distortion values for the same images (e.g. 8.1%
vs 0.25% in v13). ErrorMetric.RootMeanSquared in v14 produces the
exact same values as v13's Fuzz, preserving existing comparison
behavior and thresholds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow mattleibow merged commit fc1dadc into main Mar 18, 2026
163 checks passed
@mattleibow mattleibow deleted the copilot/update-magick-net-dependency branch March 18, 2026 18:30
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Mar 30, 2026
Update Magick.NET-Q8-AnyCPU from 13.5.0 to 14.10.4 with all breaking
API changes resolved:

- MagickGeometry/MagickImage constructors now take uint for dimensions
- RePage() renamed to ResetPage()
- Width/Height changed from int to uint
- Compare() return type changed to IMagickImage<byte>
- Drawables class moved to ImageMagick.Drawing namespace
- ErrorMetric.Fuzz behavior changed; using RootMeanSquared to preserve
  existing comparison thresholds (see dotnet#34524 for follow-up)

Also adds using var for MagickImage disposal and guards against
negative dimensions before uint casts.

Note: ErrorMetric.Fuzz in v14 is significantly more sensitive than v13
and detects real screenshot drift that was previously invisible. A
follow-up issue (dotnet#34524) tracks switching back to Fuzz with regenerated
baselines.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants