获取图像的元数据 - Android [英] Get Meta Data of Image - Android

查看:33
本文介绍了获取图像的元数据 - Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.isco.com/webproductimages/appBnr/bnr1.jpg

我使用过 网站 以查看图像的元数据.在这个网站上,它显示了图像的所有信息.我想知道如何在android中获取上图的标题"标签.

I've used a website to see the metadata of a image. In this website, it shows all info of image. I want to know how to get the "Title" tag of above image in android.

我在这里找到了仅适用于 iOS 的类似问题:如何获取图像元数据在ios中

I found here the similiar question for iOS only: How to get image metadata in ios

但是我不知道如何在 android 上获取图像的元数据".ExifInterface 只给出了一些信息.但我无法获得标题"标签.

However I don't know how to get "Meta data" of image on android. ExifInterface only gives some informations. But I'm unable to get "Title" tag with it.

您能否提供任何代码片段以在 android 中获取图像元数据?

Can you provide any code snippet for get meta data in android for image?

推荐答案

从此处给出的链接下载元数据提取器...... 点击下载库选择版本 2.5.0.RC-3.zip

Download metadata extractor from the link given here ...... click to download the library choose the version 2.5.0.RC-3.zip

解压jar文件夹

并将jar导入到你的项目中的libs文件夹中,然后执行下面的代码

and import jar into libs folder in your poject and then execute the below code

        try {
            InputStream is = new URL("your image url").openStream();
            BufferedInputStream bis = new BufferedInputStream(is);
            Metadata metadata = ImageMetadataReader.readMetadata(bis,true);


    for (Directory directory : metadata.getDirectories()) {
    for (Tag tag : directory.getTags()) {
        System.out.println(tag);
    }
 }

            }
        catch (ImageProcessingException e){}
        catch (IOException e) {}

这篇关于获取图像的元数据 - Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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