How do I compress an image uploaded by FileChooser?

0 favourites
  • 5 posts
From the Asset Store
You can upload screenshots and photos to your server very easily.
  • Hi,

    I have a FileChooser object that selects images from the local directory. I then set the image chosen to a sprite.

    Rather than setting a limit to the image size that could be selected from the local directory, I would like to compress the image. Compressing the image doesn't limit the images that can be chosen. Is there a way to do this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Compression is only useful when saving an image to disk. If the image is to be displayed it is uncompressed in memory.

    Edit:

    I just realized you may be thinking of image resizing. You may be able to utilize the snapshot action or the canvas or paster plugins to do that, but then again someone may have made a plugin to do that too.

  • Hi R0j0hound,

    This is the background: I have an image set as Base64. The file size appears to affect the size I can accept through the browser. I require four images saved as Base64 and at some point I cannot save any more images because of the limit restriction of the browser's Local Storage.

  • You can look into a recent plugin by rexrainbow that compresses strings. That would allow you to store some more data.

  • Thanks R0j0hound. I'll have a look.

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