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

Large images #3

Closed
robertasg opened this issue Jul 21, 2016 · 5 comments
Closed

Large images #3

robertasg opened this issue Jul 21, 2016 · 5 comments

Comments

@robertasg
Copy link

Hi,

Can't render an image that's over 5000x4000. Or even smaller that's relatively large in that matter. Simply shows a black screen. Any help would be appreciated (might not even be the issue with this component itself)

@gre
Copy link
Owner

gre commented Jul 21, 2016

This is an issue with WebGL/OpenGL not gl-react-image, nor gl-react*.

it even depends on your device capabilities. that limit depends on the hardware (graphic card basically).
You need to look at OpenGL (ES 2) / WebGL 's MAX_TEXTURE_SIZE value. For instance,

Max 2048x2048

  • iPhone 3GS
  • iPhone 4
  • iPad

Max 4096x4096

  • iPhone 4S
  • iPhone 5
  • iPad 2
  • iPad 3

(according to http://answers.unity3d.com/questions/563094/mobile-max-texture-size.html )

for WebGL, you can directly check it on https://www.browserleaks.com/webgl

@gre gre closed this as completed Jul 21, 2016
@dcworldwide
Copy link

dcworldwide commented Jul 25, 2016

I'm also experiencing black surface issues (and also app crashes) quite regularly. After reading your advice above @gre I tried running my react native gl test hardness https://github.com/dcworldwide/react-native-gl-image-filter-examples using a small sized test image (http://lorempixel.com/output/nature-q-c-600-480-2.jpg). The black surface issue still persists for me and I unfortunately also get intermittent crashes :(

screenshot_20160725-145218

Figure 1: Clicking the green filter sometimes shows up as black in the main surface.

screenshot_20160725-145223

Figure 2: Sometimes it works correctly. Note: The filter shouldn't be green, its a WIP

It is worth nothing that my test hardness has multiple surface instances.

I'd really like to know what I can do to help. I'd love to keep using this lib but a bit worried that i'm either using it wrong, or it's not designed to do what I'm attempting. Thanks

Cross referenced: dcworldwide/react-native-gl-image-filter-examples#1

@gre
Copy link
Owner

gre commented Jul 26, 2016

have you tried to run it in iOS too to reproduce the same bug?

I had some similar crash in the past ( gre/gl-react-native-v2#47 ) but it was only on the Android implementation, that is not as stable as the iOS one.

Any error stacktrace?
We need to track these errors to improve the Android implementation. help wanted :)

if you have a reproductible app, maybe worth creating an issue on gl-react-native as it's probably not related to gl-react-image.

thanks!

@pawellewandowski
Copy link

+1

@danielreuterwall
Copy link

@gre I know this is an old issue but I believe it's still valid. Getting a black image can be resolved by resizing the image before using it in gl-react-image. However you don't want to resize if not needed and not too much. Is there any way to detect the MAX_TEXTURE_SIZE? For iOS I could nowadays probably just resize it to 4k and all is good. Android has probably more variations so a detection would be great here. Any suggestions?

By the way, I'm using gl-react-native-v2. If this is available in v3, that could probably work but I had some issues getting it stable.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants