Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    4
    Rep Power
    0

    Smile 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?

  2. #2
    wolfcro is offline Member
    Join Date
    Feb 2009
    Location
    Italy
    Posts
    51
    Rep Power
    0

    Default

    it would be good if you write exactly on which line to you ger the error
    and write the error details too

Similar Threads

  1. Writing text into an image and save it
    By elcapi in forum Java 2D
    Replies: 6
    Last Post: 09-18-2009, 05:47 PM
  2. The server encountered an internal error ()
    By rakesh_n_mehta in forum Web Frameworks
    Replies: 0
    Last Post: 01-19-2009, 01:09 PM
  3. Logic Error: Not Writing To File
    By JDCAce in forum Advanced Java
    Replies: 6
    Last Post: 10-21-2008, 02:13 AM
  4. Description the server encountered an internal error
    By Jack in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-02-2007, 02:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •