I would like that when we upload an image, that it automatically reduces to 1200px wide max (and its height in proportion to its original size) and 72 dpi if it is larger than that. This in order to limit the weight thereafter (because it would be an online game and there would be many images). Is there a function for this?
I have attached a starting file as an attachmentweight-picture.hype.zip (70.6 KB)
You could also use some batch resize tool on your export folder once you exported.
Or you could resize them before importing them like the rest of us
You could use a service like Cloud Image but it costs some money and introduces a CDN. That service allows manipulating images on the fly and I wrote an extension that does that in Hype. A little code to set the width is needed.
and I tried to apply it in this new document (witch is in attachment. It works on computer but it crashes again on smartphone…weight-picture-2.hype.zip (70.9 KB)
It crashes because lots of pictures and not enough power on a smartphone
(not on this doc precisely because it remains simple => not many pictures to upload). Do you have a solution ?
Yes, see Reduce the weight of an uploaded photo (client side) bullet points 1. and 3.
ok I’ll watch it all, thank you :). I was hoping that a function placed on the hype doc before exporting would do the job
You can write an export script …
… and use a shell script or Python to-do some post preview/export optimization.
Thank you for this additional information