imageio

Is there a 100% Java alternative to ImageIO for reading JPEG files?

We are using Java2D to resize photos uploaded to our website, but we run into an issue (a seemingly old one, cf.: http://forums.sun.com/thread.jspa?threadID=5425569) - a few particular JPEGs raise a CMMException when we try to ImageIO.read() an InputStream containing their binary data: java.awt.color.CMMException: Invalid image format ...

Unable to aquire image through ImageIO.read(url) because of connection timed out.

Following code always fails URL url = new URL("http://userserve-ak.last.fm/serve/126/8636005.jpg"); Image img = ImageIO.read(url); System.out.println(img); I've manually checked the url, and it is valid, and contains a valid jpg image. The problem I get is; Exception in thread "main" javax.imageio.IIOException: Can't g...

Unable to do fast I/O of dynamically generated images on a IP camera

Hi, I have a image file stored at a remote server (i.e http://example.com/images).The images in this folder are getting updated at the rate of 1 image per 100 milliseconds Think of ip cams that transmit MJPEG images . I am using apache HTTP client api to connect to my remote server .I am getting a stream of the content HttpClient htt...

Is ImageIO.write buffered?

Hello! Should I write BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(file)); ImageIO.write(im, "JPEG", os); instead of ImageIO.write(im, "JPEG", file); I.e. are ImageIO file operations buffered by default or not? Thanks! ...

ImageIO not able to write a JPEG file

I have a BufferedImage I'm trying to write to a jpeg file, but my Java program throws an exception. I'm able to successfully save the same buffer to a gif and png. I've tried looking around on Google for solutions, but to no avail. Code: File outputfile = new File("tiles/" + row + ":" + col + ".jpg"); try { ImageIO.write(m...

I can't understand a leak -- Possibly Instrument fail ?

I'm trying to fix some leaks in an iPhone app, but I'm still fighting w/ one of them. It appears with Instruments, and I can see something like : ImageIO 128 bytes (Leaked Object -> Malloc) But I'm releasing nearly all used object (at least I think), could it be a false positive or some memory leak for the ImageIO library ? I know th...

How to read PGM images in Java?

I feel like I'm missing something simple here (as usual). I'm trying to read PGM images using Java. Matlab does it just fine - outputting the image pixels (for example, a small 32x32 image) in Matlab gives me something like this: 1 0 11 49 94 118 118 106 95 88 85 96 124 143 142 133 My Java reader, however, outputs this: 1 0 11 49 94 ...

JAI on RedHat 5.2

Does anyone know if there's a version of JAI that is compatible with RH 5.2? We tried to have some new code deployed to our prod server last night, but the deployment team ran into a snag. The new code uses the Java Image I/O Tools library (javax.imageio.ImageIO). This is the first time we've used any JAI functionality, so the deploymen...

JAI ImageIO-core codecLib source

JAI ImageIO-core comes with a set of native codecs. The codecs come bundled in a set of .so and .dll files. Mainly clib_jiio.dll clib_jiio_sse2.dll clib_jiio_util.dll. I was able to find the source to mediaLib (mlib) but not the source for these codecs. Anyone know where the source resides? or if they are simply not open source? ...

JAI FileLoad/FileStore Operations vs JAI ImageRead/ImageWrite Operations. Differences?

What are the differences between JAI's FileLoad/FileStore operations and its ImageRead/ImageWrite operations? Is one set better than the other in any way? Which ones should be used as a default? ...

ImageIO: ERROR - MetadataLib.dylib not found

I'm getting an odd error in my console when running my app sometimes: ImageIO: ERROR - MetadataLib.dylib not found I'm not sure what this is related to, but I am running AdMobs ads. ...

Creating a jpeg file with metadata

I have a Java application that creates a BufferedImage and saves it to disk as a JPEG. I'd really like to add a caption to the image. To prevent the image from getting crowded out by text on the image itself, it'd be great if I could write the caption to the JPEG's metadata. I've been searching all over the place for a solution, but...

Fast loading of PNG image into an array in java

I want to load (and decode) PNG images and convert them into a one-dimensional array in Java. I can obviously do this with ImageIO.read() and then copy the pixels into the array, but that consumes twice the memory (the raster + the final array) and it involves more processing time than I would like. How should I go about this? Worst-cas...

problem with saving image i get Zero kb

I'm having a problem, when I save my image I can't open it because it's empty and the size is zero kb. I'm reading the image from a folder and then I change the size to 100x100 and save it but it's not working. Here's the code I've written so far: public BufferedImage resizeImageToPreview() { final String SOURCE ="/Library/glassfishv3...