Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to read picture taken time from JPEG

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,

I am building a web page using JSF technology. One of the page has a function to upload pictures into the application and then can be viewed in a thumbnail manner.

My question is realted to Java API not JSF, one of the requirement is to display "picture taken time" along with the picture. Currently, the page displays the time when the picture was loaded as oppose to when the picture was taken. The picture format are usually in JPEG/GIF. Is there a way to retrieve the "picture taken time" from JPEG/GIF file through Java API?

I would highly appreciate any response I can get to complete this requirement.

Thanks in Advance!!

Regards
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're looking for so-called JPEG EXIF data. A Java library that can read it can be found here.

That doesn't work for GIF images, though, which simply doesn't include that data. But since GIF is not well suited for photographs it gets rarely used for that. Maybe you can even disallow GIFs?
 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!!

Regards
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!