Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Images going fullscreen and back animate to stretched fullscreen rather than to target best fit size #1122

Closed
YaLTeR opened this issue Sep 22, 2024 · 5 comments · Fixed by #1125
Labels
bug Something isn't working designer input needed mediaviewer Mediaviewer related issue

Comments

@YaLTeR
Copy link

YaLTeR commented Sep 22, 2024

Describe the bug

When clicking on an image, it crossfades into a fullscreen media viewer, but the image itself crossfades into a fullscreen stretch. Instead, it should crossfade into its target best fit location.

Steps To Reproduce

  1. Click on some image whose aspect ratio significantly mismatches the Tuba window aspect ratio.

Logs and/or Screenshots

test.mp4

You can see the problem clearly on freeze frames like:

mpv-shot0001

Instance Backend

Mastodon

Operating System

Fedora 40 Silverblue

Package

Flatpak

Troubleshooting information

os: GNOME 46 (Flatpak runtime)
prefix: /app
flatpak: true
version: 0.8.4 (production)
gtk: 4.14.5 (4.14.4)
libadwaita: 1.5.4 (1.5.3)
libsoup: 3.4.4 (3.4.4)
libgtksourceview: 5.12.1 (5.12.1)

Additional Context

No response

@YaLTeR YaLTeR added the bug Something isn't working label Sep 22, 2024
@GeopJr GeopJr added mediaviewer Mediaviewer related issue designer input needed labels Sep 22, 2024
@GeopJr
Copy link
Owner

GeopJr commented Sep 22, 2024

My initial thought is that it's not worth it (unless I'm misunderstanding what the desired outcome is).

As it stands, the ScaleRevealer (the 'animation'), works by snapshotting the source widget and the target widget and crossfading between them.

The main issue is that there are way too many moving parts to have an 'expand to target size' animation work reliably and seamlessly.

From Tuba's side, there are options to letterbox attachment thumbnails and not enlarge media in the media viewer. That means that when viewed in the media viewer, images can actually be smaller than that the thumbnail.

From fedi backends' side, thumbnail sizes might differ from the full-size attachment, video thumbnails are often square and do not match the first frame of the video. Audio files usually don't have thumbnails and the media viewer will display an audio visualizer anyway.

I can play around with it and see if maybe snapshotting the child widgets or maybe changing when the crossfade starts will have a nicer effect, but I'd rather avoid doing more complex snapshot manipulation

@YaLTeR
Copy link
Author

YaLTeR commented Sep 22, 2024

Hm, I understand that there are difficulties here, but maybe preserving the thumbnail aspect ratio during the crossfade would already make it better?

@GeopJr
Copy link
Owner

GeopJr commented Sep 22, 2024

Can you do me a favor and try the letterbox setting? To me that looks like the desired effect, if you can confirm, I can start working with that in mind:

Screencast.from.2024-09-22.15-54-53.mp4

(animation is slowed down by 1s to showcase it)

@YaLTeR
Copy link
Author

YaLTeR commented Sep 22, 2024

It seems better on your video; for me with letterboxing it still tries to stretch the image to the full screen:

Screenshot from 2024-09-22 16-11-50

Screenshot from 2024-09-22 16-12-00

@GeopJr
Copy link
Owner

GeopJr commented Sep 22, 2024

Thanks! Rethinking it a bit, we can basically just skip snapshoting the source widget (or start the cross fade much earlier so we avoid the first few ms showing the media viewer)

1.3s

Screencast.from.2024-09-22.17-20-02.mp4

.3s (default speed) (the media viewer being shown at the attachment position is more prominent when it's fast, we can just start the fading earlier to overcome that I guess)

Screencast.from.2024-09-22.17-20-57.mp4

(the first two attachments in the videos have the same aspect ratio as the ones in yours)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working designer input needed mediaviewer Mediaviewer related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants