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 8438821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:49:22+00:00 2026-06-10T07:49:22+00:00

I would like to get the metadata from an image file in my local

  • 0

I would like to get the metadata from an image file in my local system using Java code

In the attached image you can see the desired data which i would like to pull from java code.

enter image description here

I wrote the below code and do not seem pull the data mentioned in the “Details” tab. The below code’s output is and this is not what I look for.

Started .. 
Format name: javax_imageio_jpeg_image_1.0
Format name: javax_imageio_1.0

Please give me your ideas. Thanks

try {
            ImageInputStream inStream = ImageIO.createImageInputStream(new File("D:\\codeTest\\arun.jpg"));
            Iterator<ImageReader> imgItr = ImageIO.getImageReaders(inStream);

            while (imgItr.hasNext()) {
                ImageReader reader = imgItr.next();
                reader.setInput(inStream, true);
                IIOMetadata  metadata = reader.getImageMetadata(0);

                String[] names = metadata.getMetadataFormatNames();
                int length = names.length;
                for (int i = 0; i < length; i++) {
                    System.out.println( "Format name: " + names[ i ] );
                }  
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
  • 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-06-10T07:49:24+00:00Added an answer on June 10, 2026 at 7:49 am

    There’s no easy way to do it with the Java Core API. You’d have to parse the image’s metadata tree, and interpret the proper EXIF tags. Instead, you can pick up the required code from an existing library with EXIF-parsing capabilities, and use it in yours. For example, I have used the Image class of javaxt, which provides a very useful method to extract GPS metadata from an image. It is as simple as:

    javaxt.io.Image image = new javaxt.io.Image("D:\\codeTest\\arun.jpg");
    double[] gps = image.getGPSCoordinate();
    

    Plus, javaxt.io.Image has no external dependencies, so you can just use that particular class if you don’t want to add a dependency on the entire library.

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

Sidebar

Related Questions

I would like to get the file name and, if possible, album image from
I would like to know how I can get the metadata of an object
I would like to get numbers of comments for each posts using mysql. I
I would like to get a help from you all. The below is the
I would like to use sqlite (using Java JDBC, not sure if that matters)
How to get list of data items list from CRM Metadata Source in code
The image which one can get from OpenNI Image Meta Data is arranged as
I've produced a python egg using setuptools and would like to access it's metadata
I would like to get to know how to redirect output of some program
I would like to get View instance that is used to display specific Preference

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.