Comments (10)
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.
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.
All the images inside Cards
seem fine
from tokentool.
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.
I removed the whole ~/.tokentool-rptools
folder, but tokentool is recreating it
from tokentool.
Oh! deleting just the card and square folder and restarting lets tokentool start!
from tokentool.
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.
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.
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.
@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)
- Change Portrait button stopped working HOT 3
- WebP support request HOT 1
- TokenTool does not start HOT 4
- Release build should create an MSI for windows HOT 1
- Filetype selector on Save As... dialog is stuck on WebP HOT 1
- The 2.2 installer does not contain overlays HOT 1
- token tool not starting HOT 3
- TokenTool crashes on startup on Ubuntu 21.10 HOT 6
- [BUG]: TT hangs when clicking "Change Portrait Image"
- Changing portrait does not work HOT 5
- Generating two-sided tokens HOT 1
- Crash to desktop on loading HOT 4
- [BUG]: Not opening Portrait images on Windows 11 HOT 5
- Token Tool 2.2.1 will not open HOT 2
- PSD not loading into Overlay Manager HOT 1
- Add New File Format Support: AVIF HOT 3
- Updated Overlays HOT 14
- Option to not autocrop/ recentre for asymmetric overlays
- Capture Screen function freezes TokenTool (Ubuntu 22.04 XFCE)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tokentool.