如何从图片中获取元数据?

时间:2022-03-19 21:19:28

I am browsing the web but no way to find how to get metadata from a picture.

我正在浏览网页,但是找不到从图片中获取元数据的方法。

Does anyone has an idea ?

有人知道吗?

I can't see anything in the Bitmap/BitmapFactory/BitmapFactory.Options documentation that would give me a hint.

我在位图/位图工厂/位图工厂看不到任何东西。可以给我一个提示的选项文档。

I would like to retrieve standard information such as :

我想检索标准信息,例如:

  • name
  • 的名字
  • date it was taken
  • 拍摄的日期
  • dimension
  • size
  • 大小

and maybe more.

也许更多。

Any idea ?

任何想法?

2 个解决方案

#1


2  

You can get at least the size of the image by setting BitmapFactory.Options.inJustDecodeBounds to true.

通过设置BitmapFactory.Options,您至少可以获得图像的大小。inJustDecodeBounds为true。

If the image is in the MediaStore, you might be able to get more information.

如果图像在MediaStore中,您可能可以获得更多信息。

#2


2  

According to this thread

根据这个线程

http://osdir.com/ml/AndroidDevelopers/2009-02/msg00821.html

http://osdir.com/ml/AndroidDevelopers/2009-02/msg00821.html

you have to use ImageManager

必须使用ImageManager

#1


2  

You can get at least the size of the image by setting BitmapFactory.Options.inJustDecodeBounds to true.

通过设置BitmapFactory.Options,您至少可以获得图像的大小。inJustDecodeBounds为true。

If the image is in the MediaStore, you might be able to get more information.

如果图像在MediaStore中,您可能可以获得更多信息。

#2


2  

According to this thread

根据这个线程

http://osdir.com/ml/AndroidDevelopers/2009-02/msg00821.html

http://osdir.com/ml/AndroidDevelopers/2009-02/msg00821.html

you have to use ImageManager

必须使用ImageManager