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
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Image orientation

OK,have you any idea how to check it programtically?

Regards,
Arsen
Developer
Posts: 28
Registered: ‎10-05-2009
My Device: Not Specified

Re: Image orientation

No Sorry this is not something I have done myself.
Developer
Posts: 28
Registered: ‎10-05-2009
My Device: Not Specified

Re: Image orientation

Just had a quick google and found this lib dont know if it will help or get you on the right track....

 

http://drewnoakes.com/drewnoakes.com/code/exif/

Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Image orientation

You can try this pieces of code.  If orientation is "6" then it is rotated.

 

fullImage = EncodedImage.createEncodedImage(fileBytes, 0, length);

MetaDataControl m = fullImage.getMetaData();
String orientation = "";

try {
orientation = m.getKeyValue("orientation");

} catch (Exception e) {}


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Image orientation

No Jared nothing happens.However when I use encodedImage.getBitmap() it returns rotated image.

Regards,
Arsen
Developer
Posts: 656
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Image orientation

Arsen, are you ok now. Are you getting the results you need?


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Image orientation

[ Edited ]

No Steven I've used your approach but unfortunatelly the connection in some cases return just "1"(when image is ok,but sometimes "") and  "" when image is rotated.

I've also tried to import and use exiflib but I had trouble with importing it's jar file to project,I mean I import but it conteins no existing classes as I try find them  from project explorer.I've also tried to compile and use its sources but with no success.

 

p.s Sorry for bad english

Regards,
Arsen
Regular Contributor
Posts: 70
Registered: ‎06-15-2011
My Device: Bold 9900
My Carrier: Bell Canada

Re: Image orientation

JaredCo's code does work on the device, just not in the simulator.  Looks like a bug with the simulator

Thanks for the code!

Developer
Posts: 91
Registered: ‎06-21-2011
My Device: Blackberry Torch 9800
My Carrier: developer

Re: Image orientation

Do you check the same for simulator and for device?

Regards,
Arsen
Highlighted
Regular Contributor
Posts: 70
Registered: ‎06-15-2011
My Device: Bold 9900
My Carrier: Bell Canada

Re: Image orientation

I'm using the Torch 9800... it worked on the device but not in the simulator