[Bug]: Images going fullscreen and back animate to stretched fullscreen rather than to target best fit size
Closed this issue · 5 comments
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
- 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:
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
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
Hm, I understand that there are difficulties here, but maybe preserving the thumbnail aspect ratio during the crossfade would already make it better?
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)
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)