Frame filter adapting to media size

Hey everyone,
i’m working on my first filter, a simple frame around an image/video.

I’d like the frame to adapt to different screen sizes, but also to existing media. So far i have managed to adapt everything for live capture, but existing media is giving me trouble.

On ios the frame adapts to vertical videos but not horizontal or vertical images.
On Android it’s adapts to vertical videos and horizontal images but not to vertical images (right and left cut off)

Not sure if a screenshot of this mess is useful:

Any ideas? Thanks for your help.

ios horizontal:

ios verical:

android vertical (sides cut off)

sorry for that, but i can only attach one image per post

In general I use fit2Rect or fit2Screen for this (they are in the library). I also have a test case for media input here, which might be helpful.

Thanks, josh. That looks interesting, but i’m not using gallery images but existing media. I already use fit2rect to fit the cameraTexture to a rectangle.
The device patch’s screen size and screen scale are driving the sizing and positioning of this rectangle, so i guess it’s a bug how this gets reported for existing media.

Ohhhh, existing media! I really like the idea of that feature, but never got into it because there’s no dev workflow, as far as I know. You could make a simple debugger effect that displays the screen and media sizes, then maybe find a workaround based on those numbers, if there is a pattern. Otherwise, the only thing to do is to submit a bug report

Yeah, it does not seem to be made for what i want to use it for ^^"
Just found out that apparently private/link sharing effects can’t be used for existing media (it just won’t show up although it’s switched on in spark ar hub). and i doubt they will let a debug effect through review :confused: