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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:56:23+00:00 2026-06-07T12:56:23+00:00

I am familiar with working with images . I retrieve/read an image from a

  • 0

I am familiar with working with images. I retrieve/read an image from a URL, where the URL does not have a file extension. Then I wish to write/save the image to the local storage, but I have to specify the image file extension (i.e. JPG, PNG, etc.), which I cannot retrieve its extension through the BufferedImage.

Could one please point out how it can be done?
Any other method will do.

  • 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-07T12:56:24+00:00Added an answer on June 7, 2026 at 12:56 pm

    Use ImageReader.getFormatName()

    You can get the image readers for a file using ImageIO.getImageReaders(Object input).

    I haven’t tested it myself, but you can try this:

    ImageInputStream iis = ImageIO.createImageInputStream(file);
    
    Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(iis);
    
    while (imageReaders.hasNext()) {
        ImageReader reader = (ImageReader) imageReaders.next();
        System.out.printf("formatName: %s%n", reader.getFormatName());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on getting familiar with the Android SDK and I have having
I've got some syntax in a project I'm working on that I'm not familiar
I am familiar with the approach of retrieving a single file version from a
i am working on MVVM and i am not much familiar with it and
I'm working with a linux machine that I'm not familiar with, so I'd like
I'm working on some SQL code. I'm familiar with the syntax SELECT * FROM
I'm not too familiar with SQL Server, but I'm working on a script that
I'm working with a ruby website app and I'm not familiar with Ruby ,
I am working with an existing codebase that creates CVD images from a webcam
I am working with a fairly large and complicated codebase I am not familiar

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.