Repository navigation
feat(presets): image file size as a range in KB or MB - #791
Merged
Merged
Conversation
A preset's picture size limit gets a minimum next to the maximum, and both can be entered in KB or MB. The preset keeps megabytes (ImageOptions.MinSizeMb is new, default 0), so the schema is unchanged and older versions ignore the minimum. - The editor shows one "File size" row with a shared KB/MB unit; a limit under 1 MB opens in KB, and switching units keeps the values. - A lossy picture under the minimum is saved again at a higher quality, never enlarged or padded, and never over the maximum. - The final pictures of each file are measured where the maximum is checked (inside a ZIP, merged images and multi-page TIFF too). One under the minimum is saved with a notice, kept as its own flag next to any other note, in the app and the CLI. - Minimum bytes are rounded; maximum bytes are cut as before. - An image refusal under 1 MB reads in KB; videos keep MB. - CLI text prints a file whose first step only fed a merge or a multi-page TIFF once, at the end, with its result. - A minimum over the maximum can't be saved while the boxes show. Closes KnifeLemon#662
KnifeLemon
approved these changes
Oct 30, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks, @SeoJCalive! This follows the plan in #662, and CI is green.
- Settings: stored in MB, with
minSizeMbadded, so the schema stays the same and old builds ignore the new value. - Minimum: a higher quality only. Pixels are never enlarged and nothing is padded, and the maximum always wins.
- Notice: a separate flag, so "original kept / replaced" can't overwrite it. It shows in the app and the CLI.
- Where it's measured: the final pictures, before a ZIP; merge images and multi-page TIFF are included.
The 22 mutations, each caught by a test, are a nice touch.
KnifeLemon
added a commit
to gianabif14/Filee
that referenced
this pull request
Oct 30, 2026
KnifeLemon#791 added eight strings to main after this branch started (minimum file size, the KB/MB unit and the notice), so id.json was missing them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adnan-bhaldar
pushed a commit
to adnan-bhaldar/Filee
that referenced
this pull request
Oct 30, 2026
KnifeLemon#791 added eight strings to main after this branch started (minimum file size, the KB/MB unit and the notice), so id.json was missing them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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?
A preset's picture size limit becomes a range: a minimum and a maximum, entered in KB or MB. It's for upload forms that ask for something like "60 KB to 500 KB". This follows the plan in the issue. Closes #662
[minimum] ~ [maximum] [KB | MB]. One unit is shared by both boxes. A limit under 1 MB opens in KB, so 50 KB no longer shows as "0.1". Switching the unit converts both values without changing them. The preset still stores megabytes (maxSizeMb, and the newminSizeMb), so the settings schema number stays the same.--json), next to any other note on the same file.Choices I made
FileResult.UnderMinimumSize) and is added to the other note with a localized{0} Β· {1}string.Type of change
How was it tested?
dotnet format --verify-no-changesdotnet testTried it in the app (what you converted or clicked, and on which OS): the preset editor on headless Linux (X11), and real conversions with
filee-clion Linux.Changed-area tests: Core
SizeLimitTests, EnginesSizeLimitTests, the new AppPresetSizeRangeTests, and a CLI test for the notice after a step on the way.Full suites: Core 742 passed and CLI 56 passed, after rebasing on
44408715. Before the rebase, onaad99622: Engines: 1,935 passed, 190 skipped, 8 failed. Two of those (HWPX speed, FBX byte cuts) pass when run on their own. The other six are LibreOffice tests (PackageRepackerTests,SpreadsheetFormatTestsODS/XLS) that fail the same way on the base commit (aad99622) on this machine. App: 1,584 passed, 11 skipped, 4 failed.RenderTests.Engines_page_shows_versions_descriptions_and_download_speedfails on the base commit too. The other three (PresetAvailabilityTests, which open the main window) fail only whenSingleMainWindowTests.Rapid_tray_clicks_and_closes_keep_one_main_windowruns right before them: that test leaves a main window open on the base commit too (see Follow-up). They pass on their own and together with every other test this PR touches.Build warnings: the same 15 as the base commit.
Do the new tests guard the feature: I made 22 mutations, each undoing one part of the change (raising the quality, stopping at the maximum, the measuring point before the ZIP, merge and multi-page TIFF, the notice text, the CLI print timing, the editor's range check and units, minimum byte rounding and so on), and checked that a test fails for every one.
The video frame folder test needs FFmpeg, which isn't fetched for Linux here, so it only runs on the Windows CI.
Real conversions (
filee-cli, this branch)For the 300 Γ 200 picture,
filee convert --jsonlists the file with"notice": "Saved, but smaller than the minimum file size".A
presets.jsonwithminSizeMbalso loads in the base commit's build, which ignores the new value and keeps the rest.Screenshots (UI changes)
The preset editor's picture card. Before, a 50 KB limit showed as 0.1 MB; after, it shows as 50 KB.
Checklist
src/Filee.App/Assets/i18n/*.jsonfilesTHIRD-PARTY-NOTICES.mdFollow-up (not in this PR)
RunMultiPageTiffAsyncskipsSizeLimit.Check). This PR adds the minimum notice there but leaves that existing gap as it is.SingleMainWindowTests.Rapid_tray_clicks_and_closes_keep_one_main_windowends with a "tray click while releasing" still pending, so its last close opens a new main window that stays on screen. Whichever test that opens the main window runs next then finds one already open. The test order decides whether this shows up.