shamsdev/davinci

How set size downloaded images

Opened this issue · 3 comments

Hi, this tool is fantastic, works really great. In my app i download a lot of images almost together. I'm wondering if there is an option to set the size or quality of the downloaded image, because now my app is lighter (in MB) but is slower because of downloads and set of images at runtime.

Hello @davidfio, thanks for using Davinci 😉
Davinci is a client-side script, so it can't change the size or quality of image in the server. For that purpose, you should write a server-side script to change the image based on your request, something like https://placeholder.com
But if you mean that Davinci should set the size and quality of saved file after downloaded the image, actually this is a good idea. I'll plan to add this in future updates.
Thank you and take care!

I was wondering this also. Would be nice to have a get().Dimensions parameter. That way you can get downloaded width and height of the image at runtime and then scale it accordingly.

i also would like to request this as well. I have 1300 sprites. that are in windows compressed at 330MB but in App uncompressed they are 4GB in total ram usage. The pngs have to uncompressed and are not pow 2 so an internal means to resize them by half or a quarter might make it a little bit better on the ram usage.