12-11-2012 12:29 AM
I'm developing an app that uses EDGE and I have to upload some images the user takes with their camera. Should I try to GZIP the images and send them to the server or try to use the snapshot method and force a low quality picture?
12-11-2012 04:15 AM
12-12-2012 12:45 AM
I'm developing an app for OS5 and above. In the app we allow the users to take 4 pictures. These pictures will be uploaded to the server. We're working with EDGE and it's really slow so I'm wondering what's the best option for compressing the image files. I saw some code snippets with getSnapshot() that allows you to pass some arguments and specify quality. Alternatively I was wondering if I should try to do some sort of compression? Gzip? Tar? Before sending off to the server.
Also some other follow up questions...
I notice the File picker gives the "Camera" option but doesn't allow you to "select" the photo you've just taken. Do I have to try and inject the "Back" button when I open the file picker and see a change on the file system (using the journal listener) or is there a better way. That way feels so hackish and seems buggy.
12-12-2012 04:49 PM
When you capture your image, you can specify the resolution that the camera should use. I recommend this to minimize the bytes you have to process. See the getSnapshor parameters. I would also try out the CameraDemo code, as it gives the user the option of specifying this. By manipulating how CameraDemo does this, you should be able to d the same thing yourself in your program.
Once you have captured the image, you basically have an array of bytes. You can process this. You can convert this to an image, scale that, and then convert it back to bytes. All of this is compute intensive.
Images are typically stored in a compressed format, such as jpg and png. You will not get significant further compression on any of these formats.
Sorry not aware of the FilePicker processing.