使用Android SDK的我没有看到任何EXIF在我的JPEG的 [英] Using the Android SDK i'm not seeing any EXIF in my JPEG's

查看:132
本文介绍了使用Android SDK的我没有看到任何EXIF在我的JPEG的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 android.hardware.Camera 类来拍照,我发现没有EXIF数据都存储在图像。如果我使用的EXIF数据的摄像头应用程序在我的DROID所有被保存。

I'm using the android.hardware.Camera class to take pictures and i'm finding that no exif data is stored in the images at all. If i use the camera application on my DROID all of the exif data is being saved.

我试过设置与设置()和SetRotation()的旋转,看看我是否能得到一些EXIF数据显示出来。当我认为我的笔记本电脑的图像的EXIF阅读器它告诉我的图像没有EXIF数据。

I've tried setting the rotation with Set() and SetRotation() to see if I can get some exif data to show up. When I view the images on my laptop with an exif reader it tells me the image has NO exif data.

我已经看到了一些类似的帖子,但我还没有找到一个解决的办法。有没有人看到与其他手机这个问题?

I've seen some similar posts, but I have not found a solution to this. Has anyone seen this issue with other phones?

我使用了Android 2.0.1 SDK

I'm using the Android 2.0.1 SDK

推荐答案

所以经过一些研究,我发现我失去了EXIF信息,当我用下面的code将图像数据保存到SD卡。

So after some more research I found that I was loosing the EXIF information when i used the following code to save the image data to the SD card.

BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 0;
Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);
FullFileName = sdImageMainDirectory.toString() + "/DCIM/Camera/" + getDateTime() + ".jpg";
fileOutputStream = new FileOutputStream(FullFileName);
BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);
myImage.compress(CompressFormat.JPEG, quality, bos);
bos.flush();
bos.close();

我改变了上面的code到仅仅是这一点,现在从相机所有的EXIF数据是present。

I changed the above code to simply be this, and now all the EXIF data from the camera is present.

FileOutputStream file = new FileOutputStream(FileName);
file.write(imageData);

这篇关于使用Android SDK的我没有看到任何EXIF在我的JPEG的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆