javax.imageIO error...

I

Ivar

Hey guys,
So in my applicationI'm trying to use the javax.imageio.ImageIO class
in order to read images from a location into a BufferedImage object

....so something like this...

try { image = ImageIO.read(new
File(filename));---------------------->Line 10
} catch(IOException e) {
e.printStackTrace();
throw new RuntimeException("Could not open file: " +
filename);
}


But at the end of it all when I run, I get this weird error...
sun.misc.ServiceConfigurationError:
javax.imageio.spi.ImageOutputStreamSpi: Provider
com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi not found
at sun.misc.Service.fail(Unknown Source)
at sun.misc.Service.access$000(Unknown Source)
at sun.misc.Service$LazyIterator.next(Unknown Source)
at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown
Source)
at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at javax.imageio.ImageIO.<clinit>(Unknown Source)
at appli.main(appli.java:10)---------------------> See line 10 above
Exception in thread "main"

This is a fairly confusing error for I've never seen anything like this
before...any suggestions? I would really appreciate it..
 
J

John Gordon

In said:
This is a fairly confusing error for I've never seen anything like this
before...any suggestions? I would really appreciate it..

Are you sure that "filename" exists, is readable, and is an image file in
a recognized format?
 
I

Ivar

Hi,
Yea I checked that - there is a valid PNG image in the location
corresponding to the 'filename' string that I give to it
 
I

Ivar

Hi,
Yea I checked that - there is a valid PNG image in the location
corresponding to the 'filename' string that I give to it
 
A

Andrew Thompson

Ivar wrote:
....
Yea I checked that -

Checked what? Please refrain from top-poasitng - it is most confusing.
... there is a valid PNG image

According to who or what? What software has led you to
believe the image is 'valid and correct'. Note that to be
any good, a system based image viewer has to be very
robust, and figure ways to overlook, or correct, problems
with 'almost right' images.
...in the location
corresponding to the 'filename' string that I give to it

How big is the image (in bytes)? Is it proprietary?
Can you upload that image to your server and
provide the link?

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top