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

Using imagescarl throws error #133

Open LuposX opened 3 years ago

LuposX commented 3 years ago

I downloaded imagescalr and added it to the project. When trying to rezise a image withScalr.resize(this.chessImg, Scalr.Method.SPEED, Scalr.Mode.FIT_TO_WIDTH,

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/imgscalr/Scalr$Method
    at main.ChessField.<init>(ChessField.java:26)
    at main.GameRenderAWT.<init>(GameRenderAWT.java:29)
    at main.Main.<init>(Main.java:21)
    at main.Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: org.imgscalr.Scalr$Method
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 4 more

I am sure that I have added th jar ro the project so i dont know why classes would be missing.

cartesian-plane commented 9 months ago

@LuposX Hello, I have a question about the Chess game you made.

(I couldn't find any contact info so I am contacting you here) How did you handle the scaling of the chesspiece icons, as I myself have tried multiple approaches but none were good enough (batik, imgscalr, svgsalamander). The icons are always a bit blurry even if I downscale from a 4k PNG. Reading SVG's also seems to be a pain in Java. If you could point me in the right direction, I'd really appreciate it!