Results 1 to 5 of 5
  1. #1
    simantoch is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default java.lang.IllegalArgumentException: im == null!

    I am getting the following output after executing the attached code:
    Java Code:
    Available: 109980
    Reader is not found
    Image is NULL
    java.lang.IllegalArgumentException: im == null!
    	at javax.imageio.ImageIO.write(Unknown Source)
    	at javax.imageio.ImageIO.write(Unknown Source)
    	at Main_TEST.main(Main_TEST.java:48)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271)
    Can anyone please give me a solution to this problem, or can anyone suggest me any alternative ways to write image after bit-manipulation.

    Thanks in advance in anticipation of an early reply.
    Attached Files Attached Files

  2. #2
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    The problem is that at line 34: "new_img = ImageIO.read(in);", ImageIO can't read the InputStream.

  3. #3
    simantoch is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default

    And that was because I modified some header information of the image..can you please tell me how can get header information of an image format..

  4. #4
    ra4king's Avatar
    ra4king is offline Senior Member
    Join Date
    Apr 2011
    Location
    Atlanta, Georgia, US
    Posts
    396
    Rep Power
    4

    Default

    I don't know, I've never had to manually edit header information. Google might help in this situation.

  5. #5
    victor8247 is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default some suggestions

    i have run your application, the same exception thrown out. after i debug your application, i found some errors.
    new_img = ImageIO.read(in);.
    functions "read()" ->public static BufferedImage read(InputStream input) throws IOException return a BufferedImage. if it does't exits a registered ImageReader that claims can get the inputstream ,it would return null. that is said your inputstream is null in fact. So the problem is here, the inputstream is null, it would throw the exception(IllegalArgumentException).Maybe i doesn't express myself clear, i suggest you to see the API-ImageIO.read. I think you will have a better understanding...;)

Similar Threads

  1. Replies: 6
    Last Post: 03-19-2011, 08:10 PM
  2. JPA java.lang.IllegalArgumentException
    By johnwcv in forum Advanced Java
    Replies: 0
    Last Post: 03-17-2011, 11:17 PM
  3. java.lang.IllegalArgumentException error occurs
    By clint in forum New To Java
    Replies: 1
    Last Post: 12-01-2010, 05:37 PM
  4. Replies: 1
    Last Post: 08-07-2009, 10:37 PM
  5. Replies: 12
    Last Post: 05-26-2009, 02:48 PM

Posting Permissions

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