Questions tagged [javax.imageio]

The Java Image I/O API (the javax.imageio package) contains the basic classes and interfaces for reading/writing BufferedImages and RenderedImages from/to image files and streams.

The Java Image I/O API (the javax.imageio package) contains the basic classes and interfaces for reading/writing BufferedImages and RenderedImages from/to image files and streams.

Many common image I/O operations may be performed using the static methods of the ImageIO class.

The package contains classes describing the contents of image files, including metadata and thumbnails (IIOImage); for controlling the image reading process (ImageReader, ImageReadParam, and ImageTypeSpecifier) and image writing process (ImageWriter and ImageWriteParam); for performing transcoding between formats (ImageTranscoder), and for reporting errors (IIOException).

All implementations of javax.imageio provide the following standard image format plug-ins: JPEG, PNG, BMP, WBMP and GIF.

The javax.imageio package has been available since Java (J2SE) 1.4.

1092 questions
-1
votes
1 answer

ImageReader returns the wrong format by .getFormatName() method

I have problem returning jpg format. When my file is in jpg format, the final format is jpeg. My method: public String getImageFormat(InputStream input) throws IOException { ImageInputStream stream = ImageIO.createImageInputStream(input); …
Radek
  • 61
  • 1
  • 5
-1
votes
2 answers

Got on <> when I tried to add an image on the background of my JPanel

I am currently learning java and I have problem and can't find anything about it. I got an "javax.imageio.IIOException: Can't read input file!" I don't understand what I did wrong : this is my code : public class FirstWindoww extends JFrame { …
-1
votes
2 answers

what is wrong in this java file path?

im getting the "Can't read input file!" in next chunk of code try { slate = ImageIO.read(new File("flor.jpg")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); …
Sole Panic
  • 19
  • 6
-1
votes
1 answer

Using java is there a way to download an image from a website that doesn't have an extension in the typical format?

With the whole COVID-19 crisis happening around the world, I decided to embark on a nerdy little project. I am trying to make digital copies of cards in mass for magic the gathering on a game called tabletop simulator... I am also a little rusty but…
-1
votes
1 answer

How can I get the actual color of the image while uploading to Bugzilla tool using java code with out any distortion?

**I'm using the below code to fetch the multiple failure screenshots from the folder to Bugzilla tool, while uploading the pictures in bugzilla, color of the picture is disorted. [enter image description here][1]. Can any one help me to rectify this…
-1
votes
1 answer

How can I create a non-square BufferedImage from a non-square image file?

I'm trying to create a BufferedImage from an arbitrary image file and then center that image in the background of a JPanel. I don't have any problems with square images, but I can't figure out how to handle non-square images. Some debugging…
John
  • 13
  • 3
-1
votes
1 answer

input == null for a directory of Images

I have a program to find Metadata for a directory of images. I am able to find metadata for 1 image but I am unable to do it for the second image. I tried file.exists to check how my File object behaves and it reports for 1st image only. It works…
Alex Smith
  • 463
  • 2
  • 8
  • 17
-1
votes
1 answer

Image Metadata for a specified directory in Java

Here I have code for displaying metadata for 1 file. I wanted to know how can I use to display metadata for a specified directory? import java.io.*; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import…
Alex Smith
  • 463
  • 2
  • 8
  • 17
-1
votes
1 answer

Java Reading Multiple Images

I have a Mysql database which contain path of images stored in my local drive. I need to write a Java program which reads those images one-by-one. I wrote the following code: import java.sql.*; import java.awt.image.BufferedImage; import…
Ali R. Memon
  • 121
  • 1
  • 1
  • 12
-1
votes
1 answer

Image size increased twice when convert from JPG to PNG using thumbnailator

Am using Thumbnailator to compress the image in my application. Everything is work fine alone when i try to convert the JPG image to PNG. At this process the size of an image getting twice after compressing. Following code is am used to convert…
Muthu vignesh k
  • 237
  • 1
  • 4
  • 19
-1
votes
2 answers

How do you solve lagging in Java awt/swing image printing?

I am trying to make a simple game with Java swing/awt. I am have issue with lagging while printing and moving images on the screen. Here is my code below: import java.awt.*; import java.awt.event.*; import java.awt.image.*; import…
David
  • 1
-1
votes
1 answer

Compress List in a Zip

I am tring to compress a list of Images into a single zip file. public void compressZip(List lstImage) { //Abrimos una ventana JFileChooser JFileChooser fileChooser = new JFileChooser(); …
-1
votes
2 answers

Is there some other class than ImageIO to read images into BufferedImage?

I need something other than ImageIO to read in a jpeg and put into a BufferedImage object. There are issues with getting ImageIO to work in servlets. I am working with the ImageIO developers but so far no luck and it may never work on the server…
Tony Anecito
  • 347
  • 2
  • 13
-1
votes
2 answers

Adding BufferedImage objects into a Vector

I have a problem with a Vector of BufferedImage objects. I'm trying to add BufferedImage objects into the Vector but the Vector is always empty. The ImageIo.read(input1) seems not working but I don't understand why. Here's a part of my code :…
kazrak
  • 3
  • 6
-1
votes
2 answers

imageIO making button to save JFrame as PNG

I'm very confused how the imageIO works, I have this application: I would like the save button to save all of its content in the JFrame as PNG. However it does not work, when I tried this code: ImageIO.write(JFrame, "PNG", new…
Petr Cina
  • 21
  • 8