• Post Reply Bookmark Topic Watch Topic
  • New Topic

extract .jpg metadata / metadata-extractor / exif  RSS feed

 
Przemek Geminski
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mooses

I want to poses the date and in particular the time of the picture.jpg was taken. I found on web that I can deal the issue with the (metadata-extractor) but whatever I'm trying brings no effects.
Can you direct me possibly the simplest way to use this tool?

My tests were like

I'm still beginer in Java so excuse me for almost certain mistakes.
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Przemek Geminski wrote:I want to poses the date and in particular the time of the picture.jpg was taken.
...
I'm still beginer in Java so excuse me for almost certain mistakes.

No probs. However, I wonder if this isn't a bit beyond you just at the moment. It's not a criticism; just that we all have to learn to walk before we can run, and what you want to do is quite involved.
I've never tried it, and I've worked with Java for quite a while.

However, from what I see, what you're doing looks reasonable - except for one thing:
  Never, ever, ever, ever, EVER code an empty catch block.
(is that enough emphasis? )

Why? Because neither you nor your program will ever know that your try block threw an Exception, so all you'll see is "weird behaviour".

At the very least, you should putbut NEVER leave it empty.

Add that and see what happens; or show us what it prints out.

HIH

Winston
 
Przemek Geminski
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for comment. I agree that perhaps it is out of my level - I read the examples and don't get to much. But still - the main phrase "Metadata metadata = ImageMetadataReader.readMetadata(imageFile);" looks such friendly than maybe there is some detail to be fixed and it can work?

I did the Exception handling block but still nothing. Tons of red lines :/

Exception in thread "main" java.lang.NoClassDefFoundError: com/adobe/xmp/XMPException
at com.drew.imaging.jpeg.JpegMetadataReader.<clinit>(JpegMetadataReader.java:53)
at com.drew.imaging.ImageMetadataReader.readMetadata(ImageMetadataReader.java:98)
at ImageMetadata.main(ImageMetadata.java:57)
Caused by: java.lang.ClassNotFoundException: com.adobe.xmp.XMPException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more
Java Result: 1

BUILD SUCCESSFUL (total time: 1 second)
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Przemek Geminski wrote:I did the Exception handling block but still nothing. Tons of red lines :/

Which is NOT nothing, it's the Exception that you weren't seeing before; and it tells you precisely what the problem is: You're missing a class.

It even tells you what that class is: com/adobe/xmp/XMPException.

The only thing I can't tell you is why, because I've never used the tool that you're using; but I'd care to bet that you''re missing a jar somewhere in your build path.

Also: Do you see all those underlined bits in your stack trace? Those are class names, and clicking on them will take you to their documentation, which might help you (and if not, at least it will tell you what they do).

HIH

Winston
 
Campbell Ritchie
Marshal
Posts: 56209
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to a different forum.
 
Przemek Geminski
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston, thanks for your engagement. According to Campbells Ritchie suggestion I moved post to I/O and Streams section.


cheers

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