mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #769] [Issue]: Character Library cards distort cropped avatars (square crop stretched to 4:3) #370
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#370
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Romuromylus on GitHub (May 12, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/769
Originally assigned to: @Romuromylus on GitHub.
Summary
In the Character Library, the image area on each card (and the hero image in the detail panel) renders in a 4:3 aspect ratio. The avatar crop format saves a square region in source pixels, and the renderer stretches that square crop to fill the 4:3 container, leaving cropped characters visibly squished vertically / stretched horizontally.
Expected behavior
When an avatar has a saved crop, the cropped region should display undistorted in the Character Library card and detail panel — the same proportions the user saw when setting the crop in
AvatarCropWidget.Actual behavior
Square crops render distorted by the container's aspect ratio (4:3). Faces look wide / compressed vertically. Verifiable in source:
getAvatarCropStyle(packages/client/src/lib/utils.ts:143) sizes the<img>to(cw/srcWidth × ch/srcHeight)withobject-fit: fill. Combined with a non-square container, this stretches a square-in-source-pixels crop by exactly the container aspect ratio. A related bypass already exists inpackages/client/src/components/chat/ChatMessage.tsx:1179(rectangleSafeCropStyle) for RP rectangle avatars, but the Character Library has no such bypass.Steps to reproduce
Environment
Logs, screenshots, or video
Reported by a Discord user with screenshots showing the squish, plus a verified CSS workaround:
```css
.sm:aspect-[4/3] {
aspect-ratio: 1/1;
}
.aspect-[4/3] {
aspect-ratio: 1/1;
}
```
(Applied via custom theme, fixed the visual distortion.)
Additional context
Affected source lines:
Either fix the rendering math in `getAvatarCropStyle` (more invasive — ~30 consumers, can retire `rectangleSafeCropStyle`) or change just the Character Library containers from `aspect-[4/3]` to `aspect-square` so the saved square crop renders undistorted in the area where the bug is reported. The latter mirrors the user-verified CSS workaround.
Template check