Comments (7)
Not to resurrect an ancient github issue, but I did just reproduce this on my machine.
Stack trace:
java.lang.ArrayIndexOutOfBoundsException: 3834560
at com.sun.javafx.image.impl.IntArgb$ToByteBgraPreConv.doConvert(IntArgb .java:216) ~[jfxrt.jar:?]
at com.sun.javafx.image.impl.BaseIntToByteConverter.convert(BaseIntToByt eConverter.java:148) ~[jfxrt.jar:?]
at com.sun.prism.Image$ByteAccess.setPixels(Image.java:1073) ~[jfxrt.jar :?]
at com.sun.prism.Image.setPixels(Image.java:705) ~[jfxrt.jar:?]
at javafx.scene.image.WritableImage$2.setPixels(WritableImage.java:219) ~[jfxrt.jar:?]
at net.rptools.tokentool.util.ImageUtil.resizeCanvas(ImageUtil.java:173) ~[tokentool-2.0.jar:2.0]
at net.rptools.tokentool.util.ImageUtil.getImage(ImageUtil.java:126) ~[t okentool-2.0.jar:2.0]
at net.rptools.tokentool.util.ImageUtil.getOverlayThumb(ImageUtil.java:5 8) ~[tokentool-2.0.jar:2.0]
at net.rptools.tokentool.client.TokenTool.cacheOverlays(TokenTool.java:1 99) ~[tokentool-2.0.jar:2.0]
at net.rptools.tokentool.client.TokenTool.cacheOverlays(TokenTool.java:1 96) ~[tokentool-2.0.jar:2.0]
at net.rptools.tokentool.client.TokenTool.init(TokenTool.java:89) ~[toke ntool-2.0.jar:2.0]
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm pl.java:841) ~[jfxrt.jar:?]
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154( LauncherImpl.java:182) ~[jfxrt.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
Investigating the offending image file, I discovered that one of the layers had an image that extended off the canvas. By cropping that layer to the canvas size, I was able to resolve the issue.
from tokentool.
Thanks for the report. If you still have the offending file and can attach it that would help when trying to fix it so it doesn't happen again.
from tokentool.
Given that stack trace, the best we'll be able to do is catch the exception and (perhaps) interpret it as an "invalid" image. The question will be where to put it; looking at just the method names, I'm guessing the getImage() method. (And it may be appropriate to try the image in MapTool and see if it bombs as well.)
from tokentool.
Sure, I fixed the offending file but it was pretty easy to just make a new one. Attached is an image that should allow you to reproduce the exception.
Error_Translucent.zip
from tokentool.
With TT 2.2.0 bad PSD (from GIMP) files no longer produce the crash. If you don't explicitly set each Layer to the Image Size in GIMP, when you export to PSD the file is unreadable by TT. It also appears incorrect in IrfanView.
from tokentool.
Testing with 2.2 develop under Java 16. Bad images don't cause a crash, the overlay is rejected and an exception is logged. Could still use some feedback to the user as well as catching the exception.
from tokentool.
Removed from 2.2 release. Leaving open for improvements to handling.
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
- Fails to start with missing image on arch HOT 10
- 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.