elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.33k stars 548 forks source link

Video being cropped incorrectly #2359

Open nf3xn opened 1 year ago

nf3xn commented 1 year ago

Video is poorly/inappropriately cropped.

Example: https://elk.zone/mastodon.social/@ginnyhogan@mstdn.jp/110933129288661696

The text is unreadable. Viewing it on another web client you can see the entire height of the media.

stackblitz[bot] commented 1 year ago

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

userquin commented 1 year ago

It seems the aspect-ratio is set to 0.8 / 1 (https://github.com/elk-zone/elk/blob/ee88c111f20bdb703230f13ed97bf5126644c49f/components/status/StatusAttachment.vue#L32-L38) and the original aspect ratio in the video is 0.5625 (changing the video to use aspect-ratio: 0.5625 / 1; seems to fix it).

The fullSize seems to be always false and so the video has wrong dimensions (clamp(rawAspectRatio.value, 0.8, 6)):

export const clamp = (n: number, min: number, max: number) => Math.min(max, Math.max(min, n))

I guess we can change the logic in StatusAttachment.vue to use the original.

imagen

/cc @patak-dev