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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:09:26+00:00 2026-06-18T14:09:26+00:00

Attempting to read in a buffered bmp image and then convert with compression to

  • 0

Attempting to read in a buffered bmp image and then convert with compression to jpeg. Something is wrong with the buffered image line. Thank you, any help is appreciated.

public void jpegconvert(String Fname, String Crate)
{

BufferedImage image =  ImageIO.read(Fname);

Iterator<ImageWriter> i = ImageIO.getImageWritersByFormatName("jpeg"); 

// Just get the first JPEG writer available 
ImageWriter jpegWriter = i.next(); 

// Set the compression quality to 0.8 
ImageWriteParam param = jpegWriter.getDefaultWriteParam(); 
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); 
param.setCompressionQuality(0.8f); 

// Write the image to a file 
FileImageOutputStream out = new FileImageOutputStream(new File("newimage.jpg")); 
jpegWriter.setOutput(out); 
jpegWriter.write(null, new IIOImage(image, null, null), param); 
jpegWriter.dispose(); 
out.close();
}
}

Hover error says this:

no suitable method found for read(String)
    method ImageIO.read(ImageInputStream) is not applicable
      (actual argument String cannot be converted to ImageInputStream by method invocation conversion)
    method ImageIO.read(URL) is not applicable
      (actual argument String cannot be converted to URL by method invocation conversion)
    method ImageIO.read(InputStream) is not applicable
      (actual argument String cannot be converted to InputStream by method invocation conversion)
    method ImageIO.read(File) is not applicable
      (actual argument String cannot be converted to File by method invocation conversion)
  • 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-18T14:09:28+00:00Added an answer on June 18, 2026 at 2:09 pm

    problem is with this particular code:
    ImageIO.read(Fname);
    coz Fname is an String and checking API for read method it doesnt take String as argument in any of its overloaded methods

    this reference might help you

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

Sidebar

Related Questions

I'm attempting to read the file.txt into java line by line and then when
I'm attempting to read an input file line by line which contains fields delimited
I am attempting to read an image file, as a base64 encoded string and
I'm doing myDomainObject.save(flush: true) and then attempting to read the id assigned to myDomainObject
I am attempting to write an Android app which will allow me to read
I'm receiving an error when I'm attempting to consume a web service: Cannot read
I am attempting to read a json message using the json.framework. The message is
I'm attempting to read a property on a series of Sprites. This property may
I'm currently attempting to read information about an object from the web.config file and
I am attempting to read in a stream and save the read images to

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.