challenge or jpegEncoder? Once you know which one it is, check the javadocs of all methods you're calling to create these objects to learn under which circumstances they might return null.
I am just gussing but it looks like challenge is null which is returned by the method you created.
SCJP 91%, SCWCD 97%
Suresh Khant
Ranch Hand
Joined: Feb 27, 2010
Posts: 114
posted
0
Hi Thanks All for the replies
After long search and checking , I have found the exact Problem .
By the way i was using openjdk I was getting the the null pointer exception (jpegEncoder was null) but i have tested the same code using sun jkd and it works fine .
the got the tip from :
OpenJDK does not have a native JPEG encoder, try using Sun's JDK, or using a library (such as JAI
AFAIK, regarding the "pinkish tint", Java saves the JPEG as ARGB (still with transparency information). Most viewers, when opening, assume the four channels must correspond to a CMYK (not ARGB) as thus the red tint.
If you import the image back to Java, the transparency is still there, though.
my question now is How to implement that using jai so that i could run it using openjdk
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35224
7
posted
0
If you're just trying to read or write a JPEG image, use the ImageIO class - it is available on all JDKs. That's much preferable to using JAI. If you're doing something else, tell us in more detail what that is.
Suresh Khant
Ranch Hand
Joined: Feb 27, 2010
Posts: 114
posted
0
Thanks Ulf Dittmer ,
I am creating image for the capacha purpose , by the way I have already post the related code in my first post.
Suresh Khant
Ranch Hand
Joined: Feb 27, 2010
Posts: 114
posted
0
Any suggestion
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.