rkalla / imgscalr

Simple Java image-scaling library implementing Chris Campbell's incremental scaling algorithm as well as Java2D's "best-practices" image-scaling techniques.
Apache License 2.0
1.23k stars 244 forks source link

Scalr.resize Can't load standard profile: GRAY.pf #106

Closed vikas21tomar21 closed 9 years ago

vikas21tomar21 commented 9 years ago

Scalr.resize(bufImage, Scalr.Method.SPEED, Scalr.Mode.FIT_TO_WIDTH,150, 100, Scalr.OP_ANTIALIAS);

Giving error: java.lang.IllegalArgumentException: Can't load standard profile: GRAY.pf at java.awt.color.ICC_Profile$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.awt.color.ICC_Profile.getStandardProfile(Unknown Source) at java.awt.color.ICC_Profile.getDeferredInstance(Unknown Source) at java.awt.color.ICC_Profile.getInstance(Unknown Source) at java.awt.color.ColorSpace.getInstance(Unknown Source) at org.imgscalr.Scalr.(Scalr.java:344)

Please help.

ghost commented 9 years ago

@vikas21tomar21 This is a bit of a red herring - if you look at the Scalr source, the line that is failing is actually a public static final declaration:

public static final ColorConvertOp OP_GRAYSCALE = new ColorConvertOp(
            ColorSpace.getInstance(ColorSpace.CS_GRAY), null);

and has nothing to do with the resize operation - this looks like a JDK problem - which JDK and OS are you on?

CLOSING because this is not an imgscalr issue (that I can tell so far), but I will continue to reply if I can help.