Code Monkey home page Code Monkey logo

Comments (10)

Azhrei avatar Azhrei commented on May 18, 2024

Based on this from your log (see the two bold sections), I'm guessing you've got an overlay under ~/.tokentool-rptools that is messed up (corrupted, or maybe an empty file, or something similar):

Caused by: java.lang.IllegalArgumentException: Image dimensions must be positive(w,h > 0)
at javafx.graphics/javafx.scene.image.Image.(Unknown Source)
at javafx.graphics/javafx.scene.image.WritableImage.(Unknown Source)
at [email protected]/net.rptools.tokentool.util.ImageUtil.processMagenta(Unknown Source)
at [email protected]/net.rptools.tokentool.util.ImageUtil.getImage(Unknown Source)
at [email protected]/net.rptools.tokentool.util.ImageUtil.getOverlayThumb(Unknown Source)
at [email protected]/net.rptools.tokentool.client.TokenTool.cacheOverlays(Unknown Source)

If you've executed TokenTool before (an older version of it, for example), then maybe some leftover image data is the problem. You can try looking under that directory, or just rename it to something else and see if TT starts up after that. (It will recreate the directory.) If it does, then you can go back to the old directory and copy over any custom overlays you might have created.

(Because the log specifically calls out getOverlayThumb, it may be that you can just delete the thumbnail directory and restarting TT will work.)

from tokentool.

BlueDrink9 avatar BlueDrink9 commented on May 18, 2024

I had installed an old entry (AUR was out of date, and I submitted a fix there).

However, removing the contents of that whole folder sadly doesn't help.

2021-08-30 17:59:23,512 JavaFX-Launcher ERROR Appenders contains an invalid element or attribute "Sentry"
2021-08-30 17:59:23,542 JavaFX-Launcher ERROR Unable to locate appender "Sentry" for logger config "root"
17:59:23.649 (null:-1) [JavaFX-Launcher] INFO  - Overlays installed: 183
17:59:23.715 (null:-1) [JavaFX-Launcher] INFO  - Environment: Production
17:59:23.716 (null:-1) [JavaFX-Launcher] INFO  - Sentry DSN: https://[email protected]/1406000
17:59:23.716 (null:-1) [JavaFX-Launcher] INFO  - Vendor: rptools
17:59:23.717 (null:-1) [JavaFX-Launcher] INFO  - Release: 2.2.1
17:59:23.717 (null:-1) [JavaFX-Launcher] INFO  - OS: Linux
17:59:23.718 (null:-1) [JavaFX-Launcher] INFO  - 3D Hardware Available? true
17:59:23.728 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays
17:59:23.729 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Hex
17:59:24.278 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Square
17:59:24.662 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round
17:59:24.664 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Chains
17:59:25.378 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Decorated
17:59:26.496 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Runes
17:59:27.159 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Bottlecaps
17:59:27.811 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Smooth
17:59:30.037 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Round/Gears
17:59:30.174 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Create
17:59:30.237 (null:-1) [JavaFX-Launcher] DEBUG - caching /home/user/.tokentool-rptools/overlays/Cards
Exception in Application init method
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application init method
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
	at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Image dimensions must be positive (w,h > 0)
	at javafx.graphics/javafx.scene.image.Image.<init>(Unknown Source)
	at javafx.graphics/javafx.scene.image.WritableImage.<init>(Unknown Source)
	at [email protected]/net.rptools.tokentool.util.ImageUtil.processMagenta(Unknown Source)
	at [email protected]/net.rptools.tokentool.util.ImageUtil.getImage(Unknown Source)
	at [email protected]/net.rptools.tokentool.util.ImageUtil.getOverlayThumb(Unknown Source)
	at [email protected]/net.rptools.tokentool.client.TokenTool.cacheOverlays(Unknown Source)
	at [email protected]/net.rptools.tokentool.client.TokenTool.cacheOverlays(Unknown Source)
	at [email protected]/net.rptools.tokentool.client.TokenTool.init(Unknown Source)
	... 3 more
Exception running application net.rptools.tokentool.client.TokenTool

from tokentool.

BlueDrink9 avatar BlueDrink9 commented on May 18, 2024

All the images inside Cards seem fine

from tokentool.

Phergus avatar Phergus commented on May 18, 2024
Caused by: java.lang.IllegalArgumentException: Image dimensions must be positive (w,h > 0)
	at javafx.graphics/javafx.scene.image.Image.<init>(Unknown Source)
	at javafx.graphics/javafx.scene.image.WritableImage.<init>(Unknown Source)
	at [email protected]/net.rptools.tokentool.util.ImageUtil.processMagenta(Unknown Source)

processMagenta() is only used for the older PNG type overlays. You might try removing the Cards & Square folders temporarily and see if it is getting hung up on one of those. (I think those are the only ones left in PNG format.)

from tokentool.

BlueDrink9 avatar BlueDrink9 commented on May 18, 2024

I removed the whole ~/.tokentool-rptools folder, but tokentool is recreating it

from tokentool.

BlueDrink9 avatar BlueDrink9 commented on May 18, 2024

Oh! deleting just the card and square folder and restarting lets tokentool start!

from tokentool.

Azhrei avatar Azhrei commented on May 18, 2024

I'm curious which file in particular was causing the problem, but most likely this is a bug in the platform library that Java uses to read PNG files. Otherwise, we'd have heard from other users about this same issue.

from tokentool.

SagittaryX avatar SagittaryX commented on May 18, 2024

Had this same problem while running Manjaro, it seems to be the presence of JPG files in the Cards folder that causes the crash, PNG images work just fine. Investigated the issue together with a friend who is more experienced with Linux. I ran the program from source files with a few edits to make it stop crashing, specifically adding a few lines in the processMagenta function of ImageUtil.java. This is of course not a fix, but with the lines in place the program builds and launches, the only issue then is that images in the Cards folder that are JPG do not load in (or rather, they load in as 1x1 broken images).

Also suspected it might have been an issue with openJDK in Linux, but got the issue when building the source code with the Oracle JDK.

private static Image processMagenta(Image inputImage, int colorThreshold, boolean overlayWanted) {
    int imageWidth = (int) inputImage.getWidth();
    int imageHeight = (int) inputImage.getHeight();

    if (imageWidth < 1) imageWidth = 1; #newline
    if (imageHeight < 1) imageHeight = 1; #newline
    
    WritableImage outputImage = new WritableImage(imageWidth, imageHeight);
    PixelReader pixelReader = inputImage.getPixelReader();
    PixelWriter pixelWriter = outputImage.getPixelWriter();
    
    if (pixelReader == null) return outputImage; #newline

    for (int readY = 0; readY < imageHeight; readY++) {
      for (int readX = 0; readX < imageWidth; readX++) {
        Color pixelColor = pixelReader.getColor(readX, readY);

        if (isMagenta(pixelColor, COLOR_THRESHOLD) == overlayWanted) {
          pixelWriter.setColor(readX, readY, Color.TRANSPARENT);
        } else {
          pixelWriter.setColor(readX, readY, pixelColor);
        }
      }
    }

    return outputImage;
  }

from tokentool.

SagittaryX avatar SagittaryX commented on May 18, 2024

I can now also confirm that the same issue exists when running Fedora 35 from the RPM version, and it's resolved by just removing all the JPG images from the Cards folder of the install.

from tokentool.

Phergus avatar Phergus commented on May 18, 2024

@SagittaryX thanks for the follow up. We'll probably need to re-save them or maybe just replace them with webp versions.

from tokentool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.