Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

metadata - Get Meta Data of Image - Android

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

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.

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

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.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

Extract the jar Folder

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) {}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...