-
Notifications
You must be signed in to change notification settings - Fork 35
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
Shared Modifier.zoomable() shares invalid transformation when SubSamplingImage is used #108
Comments
I now realize that that example needs clarification. While a Although it's technically possible to share a single |
I believe that the example above doesn't share the state between two active composables, if that's the rub. Only one will be active at a time. This is to implement MotionPhoto support similar to Google Photos, in which you can turn the motion photo (i.e. ExoPlayer) on and off and also transform the video and photo. |
Sorry I should have probably written "if both are ever active".
Ooh that's interesting. I noticed that Google Photos uses the same width and height when it switches between images and motion videos. Can your app do the same? I would kinda expect |
Making both view the same size should not be a problem, however in the modified example above both |
This is a tricky one to wrap my head around, but I think that the underlying issue is that there are two transformations that are being combined into one. There is an initial transformation that's needed to fit the content to the layout, which is combined with the user specified transformations. In order to store user transformations that can be applied to differently-sized content, I think those would need to be separate. That way you can basically have a Currently, I think the issue is that the |
The timing of this couldn't have been any better because I just fixed this. @SzyQ wanna give |
Sure, is this snapshot in some particular maven that I can use? |
Yes, it's available in the snapshot repository: maven(url = "https://oss.sonatype.org/content/repositories/snapshots") |
Gave it a shot on my real-life example and the result was not consistent. I am switching between ZoomableImage and a Video, both have different sizes so that may be a reason for invalid transformations. I will try to provide more valuable feedback once I can spend more time on some simpler sample. |
Yep, the size needs to be the same. Are you not synchronizing the size of your images with their videos? I'm imagining that your support for motion photos will work similarly to Google Photos: screen-20241104-204426.2.mp4 |
Hey, sorry for late reply. The video has original size, which is the size of video inside motion jpg file. That can be different then the image itself. My usecase is very specific and currently what works just fine is using |
Were you able to solve this?
…On Sun, Nov 17, 2024, 12:47 p.m. Szymon Klimaszewski < ***@***.***> wrote:
Closed #108 <#108> as completed.
—
Reply to this email directly, view it on GitHub
<#108 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASG5YFZZAR42XE6UMC7VET2BDJCZAVCNFSM6AAAAABQVUQDHGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGMZDKNJZGAYDAMA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Well, not with SubSamplingDelegate, because it modifies shared ZoomableState while displayed. Ideally ZoomableState would need to just represent values of the zoom performed by user, where internal state of the Modifier.zoomable transform such ZoomableState to it's own world. |
Do you not need sub-sampling of large images? Based on the discussion above it sounded like you're using telephoto for displaying arbitrary images from the user where a painter delegate will either OOM or display a downsized image. |
Hi!
I have observed that shared
ZoomableState
like in this concept here is not scaling and translating content equally whenSubSamplingImage
is used.See the behaviour on a video:
https://github.com/user-attachments/assets/151706a0-f15e-4803-86a8-d5a3bf73ace0
Modifier.zoomable()
works perfectly fine on other types of Composables, so presumably transformations applied bySubSamplingImage
are not reflected to the ZoomableState.Dirty modification of the sample code to showcase the problem:
Is such usage actually supported?
Thanks!
Szymon
The text was updated successfully, but these errors were encountered: