-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Image] Error: invalid context 0x0 #1534
Comments
Small update: it seems to happen whenever I navigator.push() away from a certain (quite complex) screen. However, it does not happen when i push() towards this screen. Debugging shows it seems to be connected to the RCTImageDownloader (fe4b4c2). When you draw an image with height only, not specifying a width (width e.g. given by parent container), this error occurs. If you specify the width, its not occuring. |
Also seeing this. Happens when I push away from a screen that has an image with just flex: 1 as width, rather than an explicit width. |
Nick is oncall this week and I have no idea what this error is. |
Fair @sahrens 😄 - I don't have a clue either, we can wait for Nick then 👍 |
@nicklockwood Nick, have you had any luck with sorting that out? Not sure if I should debug these warnings and get them fixed by changing the styles or wait as the UI looks perfectly anyway. |
Hey guys, I just made a PR for this: #2278 - it just adds a check to the |
… size == 0 Summary: Addresses facebook#1534 When an image has a known width, but a height of 0 (which can happen if `flex: 1` is set on the `Image` element), `RCTDownloadManager` attempts to scale it to an invalid size, which results in a `NULL` `CGContextRef` and some scary warnings from UIKit: ``` <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update. ``` This adds a check for zero width or height to the `RCTClipRect` function. If either dimension is zero, it is calculated based on the aspect ratio of the source image. This ensures that we don't try to create an invalid `CGContextRef`, and that images with an unknown dimension are still scaled, blended, etc. Closes facebook#2278 Github Author: Yusef Napora <yusef@napora.org>
Merged in with 0.10.0-rc. |
Hello,
since upgrading to 0.5.0, I get a lot of the following errors, although everything seems to work as expected:
Do you have any idea where this might come from? Else I'd start to disable one plugin after the other and see what might be causing this.
Thanks
Philipp
The text was updated successfully, but these errors were encountered: