Repository navigation
Conversation
mee-ironsoftware
left a comment
There was a problem hiding this comment.
🤖 Automated
/scrutinizereview — not yet read by@mee-ironsoftware.
Automated review — verdict: fix-then-ship
Blockers: 1 · Major: 2 · Nits: 1 — 4 inline, 0 in this body.
This is deliberately a comment only: it never approves and never requests changes. The verdict above is advisory; @mee-ironsoftware will follow up.
Adds a net462 build with an internal SkiaSharp 4 + LibTiff engine mirroring the ImageSharp API, dropping ImageSharp 2.x for .NET Framework. Biggest issue: the decoder sizes the pixel buffer it hands to native SKCodec.GetPixels with unchecked width*height, so a crafted PNG header can wrap it to a tiny buffer that Skia then overruns — a memory-safety bug in a PR whose purpose is security.
Reviewed head SHA e888f2ee038451c8d99dcd7d17f767fc71537817. Re-request review on this PR to get a fresh pass.
ikkyuland
left a comment
There was a problem hiding this comment.
Ikkyu's bot auto-review (not from human)
Status: REQUEST_CHANGES. 1 blocking and 3 suggestions inline, 1 suggestion in this body.
This review is for head 8218b67. Commit ec895e4 fixes the unchecked width * height buffers and the octree loop, and I checked both fixes in the full files. One packaging defect is still open: the deploy pipeline does not sign the new lib/net462 DLL. The other notes are about a TIFF alpha difference from ImageSharp, lost netstandard2.0 test coverage, and release notes.
Findings not anchored to a changed line
⚠️ suggestion — Check the release version before you publish. The repository does not set the package version.CI/azure-pipelines-build.ymlmakes it from theIronDrawingVersionsvariable group and a counter, or frominputNuGetVersion. The latest public version is2026.11.5(tag2026.11.5=451786e). IronPdf#1146 depends on Drawing2026.3.23-prerelease, which agrees with a variable group that still holds2026.3. That version sorts below2026.11.5. A project that already has 2026.11.5 gets NU1605, and a>= 2026.11.5dependency never resolves to it. This release also removes 43 public members on .NET Framework, so the version must clearly come after 2026.11.5. Fix: publish withinputNuGetVersionset to2026.12.xor higher (or update the variable group), then rebuild the products against that version. (bot)
|
@ikkyuland Thanks for the review. Every inline item is addressed in a476710: net462 DLL signing, straight alpha for single-page TIFFs, a net481 CI job that tests the netstandard2.0 build, and the DPI release note. On the release-version suggestion in the review body: agreed. |
ikkyuland
left a comment
There was a problem hiding this comment.
Ikkyu's bot auto-review (not from human)
Status: APPROVED (re-review of 8218b67...a476710)
This delta fixes the blocking issue and the three suggestions from my last review:
sign_drawing_libraries_dll.ymlnow signs the net462IronSoftware.Drawing.Common.dll.- The net462 TIFF decoder divides by alpha again when
EXTRASAMPLESisUNASSALPHA.TiffAlphaFunctionalityruns on net48 (SkiaSharp build), net481 (netstandard2.0 build) and net80, so it also shows that the builds agree. - The new net481 test job runs the netstandard2.0 (ImageSharp 2.1.13) build in CI.
- The release notes now describe the DPI rounding change on all targets.
I found no new problems in the delta.
Note for the release: publish a version that sorts above 2026.11.5. IronPdf.Core#333, IronPdf#1146, IronWord#140 and IronXL#298 cannot drop their 2026.3.23-prerelease pin until that version is on nuget.org (latest there today: 2026.11.5).
CI: the PR validation check shows "skipping" on this head, so I did not see a green run of the new net481 job.
mee-ironsoftware
left a comment
There was a problem hiding this comment.
Re-review of e888f2e → a476710. All 8 earlier items (4 from the automated review, 4 from the second bot pass) are addressed and I checked each one in the code: PixelBuffer sizes every buffer that native code writes into using long maths, the net462 DLL is signed, TIFF unassociated alpha is fixed, the net481 job tests the netstandard2.0 build, the Svg.Skia message names 5.x, and the DPI release note is in.
One major remains, inline: the octree change no longer hangs, but it can turn the whole image into a single colour. I reproduced this on net48. Please fix it before release. The two nits are optional.
… dependency, including the DW-38 integration previously done in merge commits
…rs, stop the octree quantizer looping when colours cannot be reduced, round pHYs DPI to nearest, name the Svg.Skia version, and move net462 to SkiaSharp 4.153.3
…olution and round to the nearest DPI
…a for single-page TIFFs, test the netstandard2.0 build on net481 in CI, and note the DPI rounding change
…palette cannot be reduced further, size the pre-decode check by the decoded pixel type, and share the netstandard2.0 dependency versions with the net481 tests
9a9275e to
366bd1f
Compare
cbc8958 to
9f1bc74
Compare
…ll step to store version information in the deploy pipeline
Why
SixLabors.ImageSharp 2.x is end-of-life and its CVEs will not be patched. ImageSharp 3.x does not support .NET Framework. Our .NET Framework customers therefore had no patched path, because they consumed the
netstandard2.0build, which depends on ImageSharp 2.1.13.This PR adds a dedicated
net462build that has no SixLabors.ImageSharp dependency at all. Stacked on #159, which adds the System.Memory 4.6.x family that SkiaSharp 4 needs.What changed
Engine (
IronSoftware.Drawing.Common/SkiaEngine/, compiled only forNETFRAMEWORK)AnyBitmapuses (Image<TPixel>, pixel structs,Mutate, encoders, metadata). This letsAnyBitmap.cskeep a single code path with ausingswitch.AnyBitmaprelies on: PNG keeps gray/GA/RGB/RGBA at 8/16 bit plus pHYs; BMP is 24/32 bpp with alpha and resolution; GIF uses per-frame palettes, transparency, loop and delays.BitsPerPixelmatches ImageSharp's choice) and resolution (PNG pHYs, JFIF/EXIF, BMP).Public API on net462
net462(AnyBitmap6,Color18,Point/PointF/Size/SizeF2 each,Rectangle4,RectangleF2,CropRectangle4).netstandard2.0. I verified this with a metadata diff of both builds; the only differences are those 42 operators.Packaging
netstandard2.0;net462;net60. net462 references SkiaSharp 4.153.3, SixLabors.Fonts 1.0.0 and Svg.Skia. netstandard2.0 and net60 are unchanged..NETFramework4.6.2group (Abstractions, SkiaSharp 4.153.3, SixLabors.Fonts 1.0.0, LibTiff, System.Memory family) pluslib/net462. Release notes list the breaking changes.SystemPackages.propsnow applies to net462 too.Test-SystemAssemblyReferences.ps1: .NET Framework groups are checked against the package's matchinglib/net4xfolder (System.Memory 4.6.3lib/net462= 4.0.5.0). Thenetstandard2.0group keeps the conservative minimum.Verification
netstandard2.0,net462,net60(Debug + Release), whole solutionTest-SystemAssemblyReferences.ps1lib/net462present; net462 group has no ImageSharpSixLabors.ImageSharp.dllin output; System.Memory 4.0.5.0 bindsTest changes: on net48, tests that exercise the removed ImageSharp casts are wrapped in
#if !NET48. The newSkiaEngineFunctionality(net48 only, 17 tests) covers the same behaviours through the public API: pixel get/set, lossless and lossy round trips, transparency, crop, redact, rotate, resize, multi-frame GIF/TIFF and bit depth.CreateMultiFrameTiff_Preserves_Rgb24_Pixelscompares against the engine's own JPEG decode on net48, because libjpeg-turbo and ImageSharp differ by ±2 levels.Why SkiaSharp 4 on net462 (not 2.88.x)
Review round (DW-41)
PixelBuffer.Allocate<T>, which validates width × height (computed inlong, ≤ 2 GB) before native SkiaSharp/LibTiff code writes into them. Dimensions are also checked right afterSKCodec.Create. Regression test:Png_WithOverflowingDimensions_IsRejected.Reduce()reports progress, so re-encoding a 1-bit/2-bit palette PNG whose content needs more colours no longer hangs. It quantises to2^bitDepthcolours, as ImageSharp does. Test:OneBitPalettePng_RedactedWithAnotherColor_SavesAsPng.Math.Ceiling, so a 72-DPI PNG (2835 px/m) read as 73 and a 96-DPI one (3780) as 97. It now rounds to nearest. Multi-page TIFFs also ignoredResolutionUnit=cm, so a 96-DPI page written byCreateMultiFrameTiffBytes(stored as 37.795 px/cm) read back as 37; centimetres are now converted (8218b67). Tests:ResolutionReadbackFunctionality(PNG 72/96/300/600, single- and multi-page TIFF in inch and cm, and a multi-frame TIFF round trip). This changes the reported DPI on netstandard2.0/net6.0/net8.0 as well, always towards the correct value.lib/net462as well; single-page TIFFs with unassociated alpha keep straight colours on net462 (as ImageSharp does); a new net481 test target loads the netstandard2.0 build (ImageSharp 2.1.13 + BigTIFF guard) and runs as a Windows CI job next to net48; and the DPI rounding change is in the release notes.netstandard2.0Drawing build that use ImageSharp casts will hitMissingMethodExceptionin .NET Framework apps that pick up this package'snet462lib.Not in this PR
Update: now includes DW-38 (ImageSharp 3.2.0 / 4.1.3, net8.0, BigTIFF guard, ImageSharpLoader)
PR #159 now targets
DW-38-imagesharp-v4-framework-supportand has DW-38 merged in. This branch merges that, so publishing fromskiasharp-net462gives one Drawing version with all of it:Changes made while merging:
ImageSharpLoader: the public type is ImageSharp-typed, so it is compiled out on net462. That makes it the 43rd ImageSharp-typed API missing on .NET Framework; products must gate their calls (e.g. npoiImageUtils). An internalSkiaEngine.ImageSharpLoaderkeeps AnyBitmap's call sites shared.ImageSharpLoaderare scoped to the ImageSharp targets.Verified locally:
🤖 Generated with Claude Code