Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 31
Registered: ‎11-14-2012
My Device: Blackberry 9780
My Carrier: Digicel

Compress JPEG or lower quality snapshot?

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?

Trusted Contributor
Posts: 151
Registered: ‎06-17-2010
My Device: Curve 8900
My Carrier: Vodafone

Re: Compress JPEG or lower quality snapshot?

Hi Jaywhy13,

I didnt get what you want to do?
can you please clearly mention your problem?
------------------------------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Contributor
Posts: 31
Registered: ‎11-14-2012
My Device: Blackberry 9780
My Carrier: Digicel

I'm developing an app for OS5 and above. In the app we al...

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. 

Developer
Posts: 19,628
Registered: ‎07-14-2008
My Device: Not Specified

Re: I'm developing an app for OS5 and above. In the app we al...

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.