Conversation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates Microsoft.ML.ImageAnalytics to be compatible with SkiaSharp 3.x to prevent runtime MissingMethodException when users bring newer SkiaSharp versions into their apps.
Changes:
- Bumps SkiaSharp to
3.119.2viaeng/Versions.props. - Adds an explicit
SkiaSharppackage reference toMicrosoft.ML.ImageAnalytics.csproj. - Migrates removed/obsolete APIs in
MLImage(replacesGetPixelSpan()withGetPixels()pointer span; replacesSKFilterQualitywithSKSamplingOptions/DrawImage).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj | Adds explicit managed SkiaSharp reference (3.x no longer comes transitively via native assets). |
| src/Microsoft.ML.ImageAnalytics/MLImage.cs | Updates pixel access and resize/grayscale code paths to SkiaSharp 3.x APIs. |
| eng/Versions.props | Bumps SkiaSharpVersion to 3.119.2. |
Comments suppressed due to low confidence (1)
src/Microsoft.ML.ImageAnalytics/MLImage.cs:397
- Same as above:
SKImage.FromBitmap(_image)in the crop path adds an extra allocation/native resource per resize. Prefer drawing fromSKBitmapdirectly withSKSamplingOptionsif the SkiaSharp 3.x API supports it, to reduce per-image overhead in pipelines.
using SKCanvas canvas = new SKCanvas(dst);
using SKImage image = SKImage.FromBitmap(_image);
canvas.DrawImage(image, srcRect, destRect, new SKSamplingOptions(SKCubicResampler.Mitchell));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj
Outdated
Show resolved
Hide resolved
|
@copilot address the feedback as is necessary / valuable |
…idation Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
Addressed in 00d95ab:
The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/azp run |
|
Commenter does not have sufficient privileges for PR 7582 in repo dotnet/machinelearning |
|
@stephentoub if you let me push to this I can poke on it. |
|
Go for it |
When the PR author (or the human who triggered a Copilot PR) approves their own PR, that approval is no longer counted toward approval_count, hasAnyApproval, or owner/triager approval flags. This ensures PRs like dotnet/machinelearning#7582 (stephentoub via Copilot, self-approved) still show 'review needed' instead of appearing approved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
CI failures are all pre-existing/flaky and unrelated to the SkiaSharp changes:
A CI re-run should clear the non-macOS failures. /cc @danmoseley @stephentoub |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7582 +/- ##
==========================================
+ Coverage 69.07% 69.55% +0.47%
==========================================
Files 1483 1484 +1
Lines 274513 273211 -1302
Branches 28285 27920 -365
==========================================
+ Hits 189625 190029 +404
+ Misses 77503 75824 -1679
+ Partials 7385 7358 -27
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
eng/Versions.propsMLImage.csto fix breaking API changes:_image.GetPixelSpan()withGetPixels()pointer-based span with IntPtr.Zero validationSKFilterQuality.Nonewithnew SKSamplingOptions(SKFilterMode.Nearest)inResizeFull()SKPaint.FilterQuality = SKFilterQuality.HighwithDrawImage+SKSamplingOptions(SKCubicResampler.Mitchell)inResizeWithPadding()andResizeWithCrop()SKPaint.FilterQualityfromCloneWithGrayscale()SkiaSharppackage reference in csproj (no longer transitively pulled by native assets in 3.x)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.