How do I load picture from device gallery with size more than 4096px?

  • Hello community. I really hope that someone may help me here, because I was searching in internet for the solution for the long time and nothing that could help me.

    I need to load picture from my phone device gallery to the app. And everything is working fine, but if picture's size is more than 4096 pixels, it just becomes black (but aspect ratio is still true). Please, don't type me, that using large pictures is inefficient, I need to do this and after loading it, I decrease its scale. I have already tried:

    * file chooser + load image from URL to sprite;

    * cordova camera plugin + load image from URL to sprite;

    * file chooser + paster;

    And the result is same, always..

    It is some kind of problem with construct, the restriction. Of course, on PC everything is working fine. But another app from Play Market downloads pictures even with resolution more than 10000 without any problems, so it is not the phone's fault.

    Please, help me.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Many devices have a hardware limit in the GPU that limits images to 4096x4096.

    The only way around this is to break up the image in to tiles which are each 4096x4096 or smaller.

  • Many devices have a hardware limit in the GPU that limits images to 4096x4096.

    The only way around this is to break up the image in to tiles which are each 4096x4096 or smaller.

    So all "photo editor" programs that load images are breaking up files?

    May you please show an example, how can I break up the image into tiles? Because I have no idea. Seems like I cant do anything with image at all, and at the moment when I load it from URL it is already black.

  • Construct is a game engine so uses WebGL (essentially OpenGL) for rendering. I suspect image editors have a different design using software renderers so they don't have to deal with this limit - or they do break up the images in to tiles.

    Given Construct is designed to be a game engine and not an image editor there aren't really any features for dealing with this. The expectation is that you are making a game with much smaller sized images.

  • Construct is a game engine so uses WebGL (essentially OpenGL) for rendering. I suspect image editors have a different design using software renderers so they don't have to deal with this limit - or they do break up the images in to tiles.

    Given Construct is designed to be a game engine and not an image editor there aren't really any features for dealing with this. The expectation is that you are making a game with much smaller sized images.

    Okay, it is clear. But maybe there is a plugin or behaviour, or something else, that will make downsampling of the image so it will have lower size and be loaded after this? I can't believe that there is no way to deal with this problem

  • up

    maybe any ideas from someone though?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)