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
deedubbu
Posts: 35
Registered: ‎07-07-2011
My Device: Torch
My Carrier: AT&T

Is there a way to write/copy EXIF data?

My application is using the camera app to take a picture and then reads the resulting JPEG from the file system into an EncodedImage.  I'm able to read out some EXIF data from the EncodedImage by using EncodedImage.getMetaData().  I am then performing some scaling on the image by getting the corresponding Bitmap (EncodedImage.getBitmap()) and using the scaleInto() method.  I then use the JPEGEncodedImage.encode(Bitmap) to create a new JPEG based on the scaling.  However, the EXIF data in the original image is not carried over to the new image and I haven't found any API that allows me to write the EXIF data.

 

Is there another way to effectively copy and resize an image that preserves EXIF data or is there an easy way to write the desired EXIF data in the new image?

Please use plain text.
Contributor
Sonic_Spring
Posts: 35
Registered: ‎05-18-2011
My Device: BlackBerry 10 Dev Alpha, Blackberry 9700
My Carrier: -

Re: Is there a way to write/copy EXIF data?

Hello!

I'm trying to find some info about it too ...

Please use plain text.
Contributor
adnanyaseen
Posts: 17
Registered: ‎06-01-2012
My Device: 8520
My Carrier: Ufone

Re: Is there a way to write/copy EXIF data?

Hi, I am looking for this info too. Looked into various posts and sites but unable to find information about this. There must be someone who has done this. I too want to get the EXIF data. I am downloading Image from an Online handler and I save the image after resizing it according to the screen size. But after resizing and saving the image the Meta Data Keys are present but Values are always null. Kindly somebody help.

Please use plain text.
Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Is there a way to write/copy EXIF data?

Hi,

 

Have you tried using the scaleImage32 method:

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/system/EncodedImage.html#scale...

 

According to the docs, it should return a copy of your image.

E.

Please use plain text.
Contributor
adnanyaseen
Posts: 17
Registered: ‎06-01-2012
My Device: 8520
My Carrier: Ufone

Re: Is there a way to write/copy EXIF data?

Thanks for your reply. I am reading image from online and saving it to device using following code,

 

FileConnection fc = (FileConnection) Connector.open(path+ _imagefullname);

OutputStream oStream = fc.openOutputStream();
oStream.write(IOUtilities.streamToBytes(httpInput));
oStream.flush();
oStream.close();
fc.close();
httpConnection.close();

 

I then read the image from device and create an EncodedImage from it. But by using enc.getMetaData() I am able to get the key names. But there values are always null. Is there any API through which I can manually add the MetaData? What should I do?

 

My scenario is that, I read the XML from online handler and get Images name from it. The XML also contains the updateTime of the Image. First I save the Images to the device without checking updateTime. Second time when I open the image I have to check that if the updateTime in the XML is updated then I have to re-download the image as well. As I am unable to check the MetaData so currently I do this by comparing Image file modifiedDate and XML updateTime. But can be cases where the device time is not correct. So i don't want to depend on the device time. Any Sugggestions?

Please use plain text.