Results 1 to 2 of 2
- 02-07-2009, 07:09 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 4
- Rep Power
- 0
error encountered when writing image file
I'm new to JAI. I want to save a PlanarImage into a JPEG file. I used the following code. But i encounter a NullPointerException while executing.
PlanarImage pi=(PlanarImage)JAI.create("fileload","f1.jpg");
File f=new File("f2.jpg");
FileOutputStream out=new FileOutputStream(f);
JPEGEncodeParam p=new JPEGEncodeParam();
p.setQuality(0.1F);
ImageEncoder e=ImageCodec.createImageEncoder("jpg",out,p);
e.encode(pi);
out.close();
Can anyone help me find the error? Is there anyother solution available?
- 02-10-2009, 10:08 AM #2
Member
- Join Date
- Feb 2009
- Location
- Italy
- Posts
- 51
- Rep Power
- 0
Similar Threads
-
Writing text into an image and save it
By elcapi in forum Java 2DReplies: 6Last Post: 09-18-2009, 05:47 PM -
The server encountered an internal error ()
By rakesh_n_mehta in forum Web FrameworksReplies: 0Last Post: 01-19-2009, 01:09 PM -
Logic Error: Not Writing To File
By JDCAce in forum Advanced JavaReplies: 6Last Post: 10-21-2008, 02:13 AM -
Description the server encountered an internal error
By Jack in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 07-02-2007, 02:24 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks