Repository navigation
feat(presets): a minimum short edge resize that only enlarges (#652) - #687
Merged
Merged
Conversation
The preset editor's resize list gains "Set a minimum short edge": a picture whose shorter edge is under N px is scaled up in proportion until it reaches N; one that already does is left untouched (it never shrinks). Stored like the custom size from #593: resize "None" plus a separate minShortEdge number, so Filee 2.1.0 keeps reading presets.json (it skips the unknown property and does not resize). The resize converter never writes the new mode's name. Values from a hand-edited file are brought into 16-16384, 0 or below is ignored, and the enlargement stops at 16384 x 16384 worth of pixels so a hairline strip cannot ask for gigapixels. Enlarging uses ImageMagick's default filter, as Percent above 100 % does. The format's own limits (WebP/AVIF/JPG sides, ICO 256) and the size limit still apply afterwards. SVG sources are rendered at the needed size instead of being enlarged as a bitmap, and PDF page runs are planned at the scale the resize will use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Closes #652.
The resize list in the preset editor gets one more choice, Set a minimum short edge, with one number box (16-16384 px, default 1080). A picture whose shorter edge is under that number is scaled up in proportion until the shorter edge reaches it. A picture that already reaches it is left alone; this mode never shrinks anything. The box has a tooltip saying so.
"resize": "None"and gets a separate"minShortEdge": 1080. Filee 2.1.0 reads that file without trouble: it skips the property it doesn't know and doesn't resize.ResizeModeJsonConverternever writes the new mode's name, and presets without it don't gain aminShortEdgeentry.Not in this PR: the "Edit pictures" window from #617 isn't merged yet, so it doesn't list this mode. A follow-up will add Custom and this mode there together. No settings schema change is needed, because no built-in preset changes.
Type of change
How was it tested?
dotnet format --verify-no-changesdotnet test: the full Core suite, plus the related Engines and App tests:ImageAndPdfTests,GraphicsTests,SizeLimitTests, the preset editor render tests,DonutGroupTestsand the localization testsNew tests:
resize: "None"plusminShortEdge(every resize name is one 2.1.0 knows, and other presets don't get the property). It reads back, clones, and counts as a picture edit.ResizeMode.MinShortEdgeitself is never written.None+MinShortEdge. The value is clamped. Switching to Custom or any other mode clears it, and a hand-edited value of 0 or below opens as the preset's own resize. Same-format presets with this mode are offered for images only.Screenshots (UI changes)
Rendered headlessly by
Min_short_edge_shows_its_field_and_never_writes_a_name_older_versions_reject(en, de, ar; light and dark):tests/Filee.App.Tests/bin/<config>/net10.0/screenshots/preset-min-short-edge-*.png.Checklist
src/Filee.App/Assets/i18n/*.jsonfilesTHIRD-PARTY-NOTICES.md(none)🤖 Generated with Claude Code