I have a phonegap application that has several input fields, including text fields / text fields / captions / thumbnails / image frames / camera images. This data is uploaded to the server via ajax post.
Problem:
When downloading data, the file is unreasonably large and takes a long time to load due to images. When photographs are not added, the size is about 200 kB - 400 kB, but with images the file reaches 60 MB, and from the point of view of using an Android device with a poor Internet connection (an area with a bad signal), this is unsuitable.
What I tried:
I used image compression in the camera settings, as shown in the code snippet below, however, the problem I am facing is that different devices with different camera characteristics are used, so if the device has a low quality camera and a device with image quality image quality will occur regardless of whether the image quality is terrible.
var cameraOptions = { destinationType: Camera.DestinationType.DATA_URL, quality: 40, encodingType: 0, };
Link to the phoneβs camera API and options:
http://docs.phonegap.com/en/2.0.0/cordova_camera_camera.md.html#Camera
From the post read below, I realized that jpeg is the easiest format, so endodingType 0 is used
PNG vs GIF vs JPEG vs SVG - When is the best time to use?
What we want to achieve:
Limiting image size to 500 kB per image, and if it is more than compression.