Skip to content

feat(crop): 5:4 slice on the aspect dial, 4:5 on upright pictures for Instagram (#542) - #543

Merged
KnifeLemon merged 3 commits into
KnifeLemon:mainfrom
cre8ive-marketing:feat/542-crop-4-5
Oct 25, 2026
Merged

KnifeLemon merged 3 commits into
KnifeLemon:mainfrom
cre8ive-marketing:feat/542-crop-4-5

Conversation

@cre8ive-marketing

Copy link
Copy Markdown
Collaborator

Closes #542 (asked in #517).

@KnifeLemon, this is for your approval: it adds one slot to the crop's aspect dial. If you like it and it fits, it could go into the upcoming release. If not, I'll close it.

What it does

Instagram's portrait size is 4:5, which the dial didn't have.

  • A 5:4 slice sits between 1:1 and 4:3.
  • It turns like the other fixed ratios, so an upright picture gets 4:5 right away, and the hub (X) swaps it to 5:4.
  • No new strings and no settings change.

Crop dial with 4:5 on an upright picture

Changed:

  • CropMath (the ratio list, CanSwap, Ratio)
  • the dial's RingSegments in CropOverlayWindow.axaml
  • doc comments in AspectDial / CropOverlayViewModel
  • the list in docs/ARCHITECTURE.md

Two questions (not in this PR)

  1. Keep the ratio across a batch? Each file starts at Free, as your The_next_file_starts_free_and_full_in_view_and_canvas_alike test says. A batch for Instagram means picking 4:5 again for every picture. Should the chosen ratio carry over to the next file?
  2. A custom W:H ratio? That would be a "Custom" slice with two number boxes. Worth it, or are the fixed ratios enough?

I'll do either one after your OK.

Tests

  • CropMathTests: 5:4 and its portrait 4:5, the swappable list, the dial order.
  • New An_upright_picture_crops_at_instagrams_4_to_5_from_the_5_to_4_slice: clicks the 5:4 slice on an upright picture and checks the label (4:5), the canvas ratio and the frame. It also saves the screenshot above.
  • dotnet format --verify-no-changes is clean.
  • Full dotnet test: Platform 79, Core 602, CLI 27, Setup 155, Engines 1821 and App 1082 pass, none fail.

…ram)

KnifeLemon#542, from KnifeLemon#517: Instagram's portrait size is 4:5, which the dial didn't have.
5:4 sits between 1:1 and 4:3 and turns like the other fixed ratios, so an
upright picture gets 4:5 and the hub swaps it. No new strings.

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @cre8ive-marketing! The change is nicely contained: 5:4 goes through CropMath like the other fixed ratios, so the hub, CycleAspect, the glyph and the labels all pick it up without special cases. No new strings and no settings change. The new test checks the label, the canvas ratio and the frame on a real upright picture. Adding the 5:4 slice is fine with me.

  1. src/Filee.App/Controls/AspectDial.cs, RingSegment.Render: a seventh slice breaks the Russian "Free" label in the middle of the word. The text width is 2 * ((inner + outer) / 2 + 6) * sin(span / 2) - 12. With seven slices instead of six that drops from about 79 px to about 67 px, and a long single word only shrinks down to 9.5. In crop-dial-ru-light.png (from One_picture_shows_the_frame_its_size_and_the_aspect_dial), "Произвольные" now wraps as "Произвольны" / "е"; on main it fits on one line. Please make the longest one-word labels fit again, either with a lower size floor or with more of the slice's width, and check the ru screenshot. It's also worth checking languages that aren't in Looks, such as pl ("Oryginalne") and ne ("स्वतन्त्र").
  2. AspectDial.cs, the AspectGlyph summary still says "six slices". It is seven now. "A slice per ratio" would stay true if more are added later.

With those two fixed it's good to go once CI is green.

Russian's "Произвольные" needs 9.4 px with seven slices, so the floor goes
from 9.5 to 9. A test checks every language's free and original names
against the slice width. The AspectGlyph summary no longer counts the slices.
@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

@KnifeLemon, thanks for the review! Both are fixed in 53f2760:

  1. Long one-word labels: I measured every language's "Free" and "Original" on a seven-slice dial. Only ru's "Произвольные" falls short: it needs 9.4 px, below the 9.5 floor, so the floor goes to 9. pl ("Oryginalne") and ne fit at 12 without shrinking. The width calculation is now RingSegment.LabelWidth. A new test, Every_language_fits_its_longest_one_word_ratio_name_on_a_slice_without_breaking_it, checks every shipped language against it, so a new translation can't break a word again. crop-dial-ru-light.png shows "Произвольные" on one line.
  2. AspectGlyph summary: now says "a slice per ratio".

Crop tests (51) pass and format is clean.

Russian's label needs 8.7 px on CI's runners (9.4 on a desktop): the fonts differ, so the floor leaves room below both.
@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

@KnifeLemon, the new label test caught a difference on CI. There, Russian "Произвольные" needs 8.7 px; on my desktop it needs 9.4, because the runners' fonts differ. 2d3becb lowers the floor to 8 so it fits on both, and the label stays on one line. The packaging jobs failed only because that test did.

@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

@KnifeLemon, both points of your review are fixed (8 px floor for long one-word labels, with a test over every language; "a slice per ratio"), and CI is now green on every check. Could you take another look and merge it into main if it is good? The two #542 follow-ups (ratio across a batch, custom ratio) come after it, as agreed.

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @cre8ive-marketing! Both points are done: "Произвольные" stays on one line, the AspectGlyph summary no longer counts slices, and Every_language_fits_its_longest_one_word_ratio_name_on_a_slice_without_breaking_it keeps future translations from breaking a word. Pulling LabelWidth out so the test and Render share it is a nice touch.

One small note, not blocking: the MinLabelSize comment says the CI runners' fonts differ, but the Windows and the Ubuntu jobs both measured exactly 8.66. The dial uses the embedded Noto Sans, so 8.66 is what the app draws everywhere. If you touch the file again, the comment could just say that Russian needs about 8.7 on seven slices.

It can be merged once CI is green.

@KnifeLemon
KnifeLemon merged commit e0b68af into KnifeLemon:main Oct 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crop: 4:5 ratio for Instagram (from #517)

2 participants