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
Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified
Accepted Solution

JPGs turning green!

Hello

 

I'm trying to receive a JPG over wifi, and display it.  It sort of works, but the picture has a green hue all over it.  Does anyone know what could be causing this?  I'm creating the JPG myself on my own server, and when I save it off there the colours are correct.  Seemingly doing

 

m_bitmap = Bitmap.createBitmapFromBytes(jpgData, 0, (int) frameSize, 1);

 

Causes a green hue to appear all over the picture.  Anyone any clues?

 

Thanks,

 

 

Dave 

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: JPGs turning green!

I think that means that the JPG from your server is saving it in a format that is not compatable with the BlackBerry. It is showing up but is not being decoded correctly.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Re: JPGs turning green!

Hmm yes - interesting.  If I make the picture greyscale it works fine, but obviously that's not very acceptable.  Playing with other options on the encoding seemingly render the image unreadable by the BlackBerry.  Is there a hint somewhere whereby I can encode my JPG so that the libraries can make sense of it?

 

Cheers...

 

 

Dave 

Developer
Dave-F
Posts: 20
Registered: ‎02-20-2009
My Device: Not Specified

Re: JPGs turning green!

I kept playing about with it and got it working.  If anyone else happens to be in the same boat:

 

Mode: BASELINE

Colour: YCBCR

Sampling: 444

 

Cheers,

 

 

Dave