How do I compress an image uploaded by FileChooser?

Get help using Construct 2

Post » Tue Sep 20, 2016 9:13 am

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?
B
9
S
2
Posts: 18
Reputation: 619

Post » Tue Sep 20, 2016 9:31 am

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.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Tue Sep 20, 2016 10:27 am

Hi R0j0hound,

This is the background: viewtopic.php?f=147&t=178204 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.
B
9
S
2
Posts: 18
Reputation: 619

Post » Tue Sep 20, 2016 10:33 am

You can look into a recent plugin by rexrainbow that compresses strings. That would allow you to store some more data.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Tue Sep 20, 2016 10:38 am

Thanks R0j0hound. I'll have a look.
B
9
S
2
Posts: 18
Reputation: 619


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests