I have a “cloud” based app which is written in Corona. I am coming into problems with how some of the functionality works with regards images.
One of my screens allows the user to either take a photo or load a photo from their library. I use the standard sdk tools such as media.capturePhoto and media.selectPhoto.
The problem is that the newer types of Tablet are now taking photos at increasingly higher resolution. My app loads the image into a cloud server so I am using the end user’s standard internet connection for the load.
I don’t need an HD image, but the load time is of HD image so on a UK mega slow 6 mb internet connection the user could be waiting 20 to 25 seconds for the load to complete. Not really the snappy response I originally intended.
Is there any tools anyone knows about that would allow me to reduce an image within LUA prior to the load? My thinking is I keep a little database of different devices. If it is an IPAD 2 I reduce the image by 50% in quality. IPAD Air, maybe reduce by 70%. Android Hudl 2, maybe reduce quality by 25%.
At present, I am doing something like this, but only at the server layer (e.g. after the image has arrived). I currently reduce the file size prior to loading it into my database, but this is written in .Net code and uses a load of Microsoft built in functions that I am struggling to find in the Lua or Corona code base.
I basically want to create a new image, based on the user image, reduce everything by a percentage, save it and then load it!
Anyway, I am waffling on here. Hope you understand my issue. Any ideas?