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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer
Accepted Solution

i got an error while converting an bitmap to jpeg

hi frends,

 

in my third party app.

i am uploading an image in jpeg format.

 

here i am getting an exception why i got this error

 

 JPEGEncodedImage image=(JPEGEncodedImage)EncodedImage.createEncodedImage(data,0,data.length);

 

IllegalArgumentException.

is this correct way to get the jpeg image.

 

please help me.

 

Thank you.

New Developer
Posts: 134
Registered: ‎01-11-2011
My Device: curve

Re: i got an error while converting an bitmap to jpeg

here image is a bitmap

JPEGEncodedImage jpg=JPEGEncodedImage.encode(image, 100);

 

 

press kudos if it helps

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

Re: i got an error while converting an bitmap to jpeg

Hi bh1r1th,

 

Your syntax for encoading is wrong..

 

you have to try..

 

JPEGEncodedImage jpegencodedimage = JPEGEncodedImage.encode(bitmap, 80);

 


 

Don't Say Thank You... press the kudos button  on the right side to thank the user that helped you.

please mark posts as solved if you found a solution.

Developer
Posts: 105
Registered: ‎06-23-2010
My Device: 9000
My Carrier: vodaphone

Re: i got an error while converting an bitmap to jpeg

I have had issues doing this if the image was simply too big. How big is the JPEG?

 

 

-matt

Press Kudos if this helped - ;-)
Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: i got an error while converting an bitmap to jpeg

thank you for the replay

albert_anks

but that method is not available in 4.2 version.

 

i got the solution for that

 

check this post

 

http://supportforums.blackberry.com/t5/Java-Development/Jpeg-encoder-source-code-here/m-p/1022337

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

Re: i got an error while converting an bitmap to jpeg

Good.  Can you  mark this as solved then?