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

Offscreen Rendering issue with some PNG formats #1505

Closed
floriangbh opened this issue Jul 9, 2024 · 3 comments · Fixed by #1519
Closed

Offscreen Rendering issue with some PNG formats #1505

floriangbh opened this issue Jul 9, 2024 · 3 comments · Fixed by #1519
Milestone

Comments

@floriangbh
Copy link

floriangbh commented Jul 9, 2024

Describe the bug

Hello,

I just tried to migrate to the new offscreen rendering API with ImageScreenObject.
In some cases, the image is set correctly, but in others, the application crashes on draw.

AssetScreenObject seems to be also concerned with native video taken with the phone.

To Reproduce

Use ImageScreenObjet with PNG from assets :

if let image = UIImage(named: "test")?.cgImage {
            imageScreenObject.verticalAlignment = .middle
            imageScreenObject.layoutMargin = .init(top: 0, left: 0, bottom: 16, right: 0)
            imageScreenObject.cgImage = image
        } else {
            Logs.info("no image")
        }

With this image (just a screenshot) :

Screenshot 2024-07-09 at 11 28 25

Result to :

Screenshot 2024-07-09 at 11 29 56

Expected behavior

Integrate all kinds of PNG

Version

v1.9.1
xCode 15.4

Smartphone info.

No response

Additional context

No response

Screenshots

No response

Relevant log output

No response

@shogo4405
Copy link
Owner

I have a hypothesis that crashes occur when the composite range of the PNG exceeds the screen size. To fix the issue, I need the following information:

  1. Please provide a reproducible PNG file that causes the issue.
    • It's okay to send it via Gmail.
  2. Please let me know the screen size.
    • screen.size = ???

Thank you.

@floriangbh
Copy link
Author

The image size is the reason for the crash.

With rtmpStream.screen.size : (1280.0, 720.0) You can reproduce the crash with this image (1280x800) :
fail

If I switch to a 1280x720 everything is ok, thanks !

@shogo4405 shogo4405 reopened this Jul 12, 2024
@shogo4405
Copy link
Owner

It's not good to crush, so I think it's better to either issue a warning or have the framework handle the clipping. For now, please avoid the issue using the above method. I will try to fix. Reopen.

@shogo4405 shogo4405 added this to the 1.9.3 milestone Jul 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants