Is there anyway to reduce the size (both in pixels and KB) of a base64 image that I capture using a camera. I am trying to reduce the size of the image before loading it to the database.
Is there anyway to reduce the size (both in pixels and KB) of a base64 image that I capture using a camera. I am trying to reduce the size of the image before loading it to the database.
There might be a way to do it.. you should search for a possible solution/library to do that.
I have been looking, but I have not been very successful.
I cannot be the only one on the planet facing this problem.
In my app I allow the user to take a bunch of pictures, which they can upload to the database. All this works fine.
Also in my app, I allow the user to view Thumbnails of the actual pictures, which they can select if they wish to see the picture in full size. As you can imagine, downloading all the pictures in their full size to show as thumbnails is a very slow and wasteful process.
I would ideally like to reduce the image size (in bytes) on the server side and return the reduced image to the client.
Any suggestions or brilliant ideas?
Thanks so much in advance.
Hi Bahar,
Probably canvas can help:
http://stackoverflow.com/questions/19...
http://davidwalsh.name/resize-image-c...
You can then get base64 from it:
http://stackoverflow.com/questions/15...
Can I use canvas on the server side script, without actually having a document on the server ? OR is there some other way ?
Hello! [quote:]Can I use canvas on the server side script, without actually having a document on the server ?[/quote] no, there is no way to use Canvas in ServerCode. To create thumbnail for PNG pictures you can use https://github.com/niegowski/node-pngjs library. This library is to read/save PNG files. But decreasing picture size algorithm should be coded by you.
So how can this be done on the client side before uploading the image to the server ?
Please take a look here https://getsatisfaction.com/apperyio/...
That works nicely.
Thank you!
you can try this free online service to convert image to base64 string online.