imagej / imagej-legacy

ImageJ+ImageJ2 compatibility layer
https://imagej.net/libs/imagej-legacy
BSD 2-Clause "Simplified" License
17 stars 25 forks source link

IJ1Helper: Load icon via javax.imageio.ImageIO #245

Closed frauzufall closed 4 years ago

frauzufall commented 4 years ago

This seems to fix a java.lang.IllegalStateException: zip file closed during ImageJ launch for me.

Can others test if this works for them as well? @kephale @NicoKiaru

The issue was mentioned in the forum and on gitter.

frauzufall commented 4 years ago

I also added xvfb to travis since the tests seem to fail otherwise.

NicoKiaru commented 4 years ago

I confirm this PR is solving the issue on my side.

I checked again if I could reproduce the issue, just to be sure.

With the commit https://github.com/imagej/imagej-legacy/commit/65307e32bfec0531aced195552917e6458785970 (just before the PR) I get:

Uncaught error fetching image:
java.lang.IllegalStateException: zip file closed
    at java.util.zip.ZipFile.ensureOpen(ZipFile.java:686)
    at java.util.zip.ZipFile.getInputStream(ZipFile.java:366)
    at java.util.jar.JarFile.getInputStream(JarFile.java:447)
    at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:164)
    at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:127)
    at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:263)
    at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:205)
    at sun.awt.image.ImageFetcher.run(ImageFetcher.java:169)

and the next two commits solve this issue.

hinerm commented 4 years ago

@ctrueden this PR fixed things for me as well. I think it needs to be in pom-scijava 29.

ctrueden commented 4 years ago

Thanks a lot @frauzufall :beers: