Open BlueDrink9 opened 3 years ago
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 net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.processMagenta(Unknown Source) at net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.getImage(Unknown Source) at net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.getOverlayThumb(Unknown Source) at net.rptools.tokentool@2.2.1/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.)
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://312e480e6390426095b0a66a11f343a9@sentry.io/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 net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.processMagenta(Unknown Source)
at net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.getImage(Unknown Source)
at net.rptools.tokentool@2.2.1/net.rptools.tokentool.util.ImageUtil.getOverlayThumb(Unknown Source)
at net.rptools.tokentool@2.2.1/net.rptools.tokentool.client.TokenTool.cacheOverlays(Unknown Source)
at net.rptools.tokentool@2.2.1/net.rptools.tokentool.client.TokenTool.cacheOverlays(Unknown Source)
at net.rptools.tokentool@2.2.1/net.rptools.tokentool.client.TokenTool.init(Unknown Source)
... 3 more
Exception running application net.rptools.tokentool.client.TokenTool
All the images inside Cards
seem fine
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 net.rptools.tokentool@2.2.1/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.)
I removed the whole ~/.tokentool-rptools
folder, but tokentool is recreating it
Oh! deleting just the card and square folder and restarting lets tokentool start!
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.
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;
}
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.
@SagittaryX thanks for the follow up. We'll probably need to re-save them or maybe just replace them with webp versions.
Describe the bug Fails to start with missing image
I imagine this is an issue with installation on arch, so I'd appreciate help manually fixing it (and I'll share results with the package maintainer)
To Reproduce start app, which fails
TokenTool Info
Desktop (please complete the following information):
Additional context
Installed from AUR, with a modified pkgbuild to get the latest version installed.
Debug log: