Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:26:24+00:00 2026-05-25T01:26:24+00:00

I am looking to extract the camera related information from a jpg using Java.

  • 0

I am looking to extract the camera related information from a jpg using Java. I have looked around but have not been able to find a solution to my problem. I am exporting my photos from Aperture on my mac (OS X 10.7) and want to use the data from Aperture that is available in the file info.

Any ideas?

I am looking to have Dimensions and Key Words extracted from photos like this one: 80.167.88.49/masters/test.html. Currently i get an exception when trying to use the Metadata Extractor. I don’t know if Aperture is adding information that cannot be handled but it throws an exception on all photos from Aperture.

Exception in thread "main" java.lang.NoClassDefFoundError: com/adobe/xmp/XMPException
    at com.drew.imaging.jpeg.JpegMetadataReader.extractMetadataFromJpegSegmentReader(Unknown Source)
    at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(Unknown Source)
    at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
    at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
    at ImageScaler.main(ImageScaler.java:141)
Caused by: java.lang.ClassNotFoundException: com.adobe.xmp.XMPException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 5 more

Code:

public static void main (String[] args){

    File image = new File("/Users/peterla/Desktop/P8214462.jpg");

    Metadata metadata = null;
    try {
    metadata = ImageMetadataReader.readMetadata(image);
    } catch (ImageProcessingException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }

    Directory directory;

    // Keywords
    directory = metadata.getDirectory(IptcDirectory.class);
    String keywords[] = directory.getStringArray(IptcDirectory.TAG_KEYWORDS);

    // Dimensions
    directory = metadata.getDirectory(JpegDirectory.class);     
    String height = directory.getString(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
    String width = directory.getString(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);     
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:26:24+00:00Added an answer on May 25, 2026 at 1:26 am

    Metadata Extractor has a simple interface for reading several types of metadata from many digital image formats. This includes the EXIF metadata format used in jpeg images. The library has good Javadoc style documentation.

    The primary entry point into the library is the ImageMetadataReader object.

    The Getting Started page has a nice intro, including a nice example of how to get a value for a specific tag from EXIF format metadata.

    Update: Example for Extracting Keywords and Dimensions

    Directory directory;
    // Keywords
    directory = metadata.getDirectory(IptcDirectory.class);
    String keywords[] = directory.getStringArray(IptcDirectory.TAG_KEYWORDS);
    
    // Dimensions
    directory = metadata.getDirectory(JpegDirectory.class);     
    String height = directory.getString(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
    String width = directory.getString(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
    

    Alternatives

    Alternatives include the builtin java ImageIO library and Sanselan.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking to extract human readable schedule information from the ReportServer.dbo.Schedule table using
I'm looking for solution to extract some node from large xml file (using xmlstarlet
Looking for solution to extract content from a PDF file (using console tool or
I've been looking at examples of using sed to extract a substring using regex
i am looking for a method in java, to extract certain bytes from an
I am looking for an Java API to extract and control content from an
I'm looking to extract values from a whole load of html (i've just trimmed
I'm looking for a .NET regular expression extract all the URLs from a webpage
I'm looking for a method to reliably extract the host name from a URL
I am looking to take a PDF and extract any text from it. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.