Skip to content

Downgrading image resolution aspect ratio fix#498

Open
rbrtcs1 wants to merge 1 commit intoHaidra-Org:mainfrom
rbrtcs1:patch-3
Open

Downgrading image resolution aspect ratio fix#498
rbrtcs1 wants to merge 1 commit intoHaidra-Org:mainfrom
rbrtcs1:patch-3

Conversation

@rbrtcs1
Copy link
Contributor

@rbrtcs1 rbrtcs1 commented Feb 7, 2026

This code attempts to improve the method for downgrading width and height of images.

The old method: subtract 64 from width and height until "ok" size.

The new method: Scale width and height to exactly max_resolution, maintaining aspect ratio. Then snap down to the nearest multiple of 64.

This still doesn't guarantee maintaining the aspect ratio, but it should get much closer in most cases.

(I don't have a local instance of this running so I can't test it myself, but the code is fairly straightforward)

This code attempts to improve the method for downgrading width and height of images.

The old method: subtract 64 from width and height until "ok" size.

The new method: Scale width and height to exactly max_resolution, maintaining aspect ratio. Then snap down to the nearest multiple of 64.

This still doesn't guarantee maintaining the aspect ratio, but it should get much closer in most cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant