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

Web and WebWorks Development

Reply
Contributor
BBKate
Posts: 20
Registered: ‎12-22-2012
My Device: PlayBook
My Carrier: Verizon
Accepted Solution

Detecting portrait-oriented photos on BB10 device?

It seems whenever I load a portrait-oriented camera file into a <img> element via javascript on my Z10, it always shows portrait photo dimensions as width > height, displaying it sideways.

 

Also, if I access Z10 camera files via my PC, it also shows portait photos sideways (and dimensions listed with width > height).

 

Screenshots taken in portrait work fine. It's just a problem with camera photos it seems.

 

The same exact code works fine on the PlayBook however, properly showing portrait photos in both img elements and when accessed from a PC.

 

Known bug? Is there a workaround, or a way for me to detect the intended orientation aside from comparing width and height?

Please use plain text.
BlackBerry Development Advisor
anzor_b
Posts: 164
Registered: ‎09-24-2012
My Device: White BlackBerry 10
My Carrier: Bell

Re: Detecting portrait-oriented photos on BB10 device?

Hi BBKate,

 

The rotation data for images taken with the camera is stored as EXIF data, which requires the "app" (in this case browser/webworks) to read EXIF and rotate it.

 

This is currently in the works, but take a look at the following article on reading EXIF data, where you can rotate it yourself:

http://devblog.blackberry.com/2013/04/blackberry10-webdev-exif/

Please use plain text.
Contributor
BBKate
Posts: 20
Registered: ‎12-22-2012
My Device: PlayBook
My Carrier: Verizon

Re: Detecting portrait-oriented photos on BB10 device?

Thank you! Exactly what I needed to know. Apologies for not finding that myself during my Googling :smileyhappy:

Please use plain text.