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
famu1hundred
Posts: 20
Registered: ‎02-16-2010
My Device: 9800
My Carrier: AT&T
Accepted Solution

JPGDEC bad jpeg status 23

i have an application that invokes the camera, uses a FileSystemJournalListener to retrieve the newly taken photo, and adds a thumbnail of that photo to the application screen that raised the invocation.

 

This is working all fine.

 

However, on occasion (and I cannot pinpoint exactly when or how) the debug screen reports "JPGDEC bad jpeg status 23".

I'm not sure what this means but it causes the image retreived to only show about half of the thumbnail after createBitmapFromBytes is called.

 

It also seems to only happen with certain images or images taken from the camera.

 

Any suggestions to what this is???

Please use plain text.
Administrator
MSohm
Posts: 14,421
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: JPGDEC bad jpeg status 23

It sounds like your application has read in the JPEG file before it has been completely written out/saved by the camera application. 

 

This is discussed here:  http://supportforums.blackberry.com/t5/Java-Development/Handling-fileJournalChanged-Events/m-p/16648...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
famu1hundred
Posts: 20
Registered: ‎02-16-2010
My Device: 9800
My Carrier: AT&T

Re: JPGDEC bad jpeg status 23

Thanks for the quick response. The only real difference I saw was waiting a few seconds (which is what I suspected needed to happen). So I added a Thread.sleep(1800). I'm not sure that it actually sleeps that long but I haven't been able to reproduce the problem. Is there a way I can check? When I run the debug, it executes the Thread.sleep() method but continues on like any other line

 

Cheers

Please use plain text.
Contributor
famu1hundred
Posts: 20
Registered: ‎02-16-2010
My Device: 9800
My Carrier: AT&T

Re: JPGDEC bad jpeg status 23

Talk about an ID 10 T error. I just realized that 1800ms is 1.8 secs so of course I wouldn't have been able to see alot of difference. I changed it to 2000 and just tested it out, it seems to be waiting 2 secs. Still haven't been able to reproduce the "bad jpeg status 23" error but I'm waiting for one individual to test on his device. He was the only one that was having the problem...I simulated with his device though.

 

Please use plain text.
Contributor
famu1hundred
Posts: 20
Registered: ‎02-16-2010
My Device: 9800
My Carrier: AT&T

Re: JPGDEC bad jpeg status 23

Turns out that the Thread combined with checking if the image being taken was large fixed the problem. The Bitmap.creatBitmapFromBytes() was throwing an OutOfMemoryException. The user was taking photos in Large(2048x1068) resolution. I solved the problem by checking the length of bytes and setting a scale for the thumbnail. Thanks for the help.

Please use plain text.