3

I want to read properties like created_date, modified_date, creator, etc... in Java, of the below image file formats:

  • GIF file
  • JPEG
  • TIFF
  • CDR

I have used javax.imageio but I didn't find the solution. Any help would be appreciated

2
  • You could take look at this example which uses the meta-data from a GIF to render the animation contained within Commented Jun 23, 2014 at 6:33
  • Have a look here exiv2.org Commented Jun 23, 2014 at 8:06

2 Answers 2

4

you can use metadata-extractor like ..

Metadata metadata = ImageMetadataReader.readMetadata(imageFile);
Sign up to request clarification or add additional context in comments.

4 Comments

i have tried this but i wont be able to get metadata like created date,modified date,creator etc
@prasanna, you can get all those values and more using the library. Check here for information on how to access a specific tag's value.
@DrewNoakes but is there a generic approach? Especially for image dimension the only way I found with your library so far is to deal with specific implementation, while I would just like to have something like Image#getWidth. It is kind of a pain to have to know that for jpeg that is value 3 and for png is 1. Maybe a new question?
@ThanksForAllTheFish not in the library. It would be a useful addition, though tricky to get right. This issue tracks the idea, so please share your thoughts there github.com/drewnoakes/metadata-extractor/issues/10
2

Try Apache Tika. It's very mature and well-suported metadata extraction libraty.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.