语言

Menu
Sites
Language
No EXIF format (orientation problem)

Hello,

when we are capturing photo (in portrait mode) callback function OnCameraCaptured gives as first parameter buffer with JPG image, which contains all EXIF data.
If we make photo in portrait or landscape mode and we are using SetExifOrientation well, our EXIF data tags (for 8MPx photo) are like:

<tiff:ImageWidth>3264</tiff:ImageWidth>
<tiff:ImageLength>2448</tiff:ImageLength>
 
<exif:PixelXDimension>3264</exif:PixelXDimension>
<exif:PixelYDimension>2448</exif:PixelYDimension>
 
only tiff:Orientation element holds information about JPG orientation/rotation  ...
Now if we want to change our picture/make some filter/whatever we need to covert our JPG buffer to ARGB8888 bitmap:
Bitmap* bmp = img.DecodeN(capturedData, IMG_FORMAT_JPG, BITMAP_PIXEL_FORMAT_ARGB8888)
​​
but there is a probelm our bitmap will be in landscape orientation because it decode using "ImageWidth" and "ImageHeight" element value.
So by decoding our bitmap will always be landscape orietation, and by decoding we lose all EXIF data...
 
 
We make some fancy things with our bitmap, and now we want to save it as JPG.... whatever we do... EncodeToBufferN and CreateContent, or EncodeToFile we have no EXIF data, no orientation data, so our JPG will be landscape always...
 
There is no API for managing exif data....
 
Is using external managing EXIF library is only way to read EXIF from captured image, and then Write it to our decoded->changed->encoded JPG?
Any ideas?
 
Regards
 

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

7 回复
I am having the same problem and have posted a topic about capturing in vertical mode since the cam captures photos always where width > height However, the only solution I found is to resize the bitmap after encoding it using ImageBuffer API ResizeN (bitmapHeight, bitmapWidth);
Michał
But how Resizing function can rotate image...
I don't know what kind of processing you are doing to the image but if you want to have height > width use ResizeN but if you want just to rotate it use RotateN
Michał
I don't want to have height > width, ... like I said "If we make photo in portrait or landscape mode and we are using SetExifOrientation well, our EXIF data tags are the same"... width is bigger. Problem is the EXIF orientation element, which is lost because of decoding and encoding back... PS. ImageBuffer memory is representation is probably ARGB8888, so loading 8MPx photo to ImageBuffer takes 30MB... after RotateN, next 30MB... it gives 60MB only for bitmaps
Ok, I understand... I had similar problem.. I was only working on 1-2MB images .. after saving the image with EncodeN the orientation was lost and the output had wrong orientation and therefore I did ResizeN for vertical bitmap (images with 90 deg rotation) to make the photo look correct. Sure, setting the EXIF orientation the right way but I had to find a solution for my app. I did not have any idea how to set the EXIF orientation element.. I hope others can help you
tizendevteam T
Hi all, We would like to inform you that in the camera app we use the buffer info to create the image. We are using the content create method to generate the image. Before capturing image we set the Exif information of the camera object. Please check the exif information of the image using ImageBuffer::GetImageInfo() method of Tizen media. Depending on this user should rotate the image. Thanks
Michał
Like I said, OnCameraCaptured buffer has all EXIF info which was set to camera object. But after decoding it to ARGB all EXIF info is lost. And after encoding ARGB to JPG there is no EXIF info. I already worked it out and i'm writing EXIF data to JPG by myself. But it's not easy (studying EXIF and JPG format on byte level) and there should be added some Tizen API for that in next updates.. Regards