07-15-2011 03:02 PM
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?
11-22-2012 03:42 PM
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.
11-22-2012 05:26 PM
Have you tried using the scaleImage32 method:
According to the docs, it should return a copy of your image.
11-22-2012 06:51 PM
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();
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?