Re: Read/open image from resource inside a JAR file?
Posted by
Burger Wilhelm on
Jun 01, 2016; 2:53pm
URL: http://imagej.273.s1.nabble.com/Read-open-image-from-resource-inside-a-JAR-file-tp5016554p5016570.html
Hi John,
excellent hint! -- works well, but unfortunately my images are not necessarily in TIF format.
Thanks much,
Wilhelm
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of John Hayes
Sent: Dienstag, 31. Mai 2016 18:19
To:
[hidden email]
Subject: Re: Read/open image from resource inside a JAR file?
Hi Wilhelm,
I believe the ij.io.Opener class has an "openTiff(java.io.InputStream in, java.lang.String name)" function that returns an ImagePlus object (if that's the type of images in your .jar file). You should be able to pass a JarInputStream to it to retrieve your images.
HTH,
John
Le 31 mai 2016 à 10:22, Burger Wilhelm a écrit :
> Hello group,
>
> does anyone know of a straightforward way to read/open an image that is contained as a resource inside a JAR file? That is, without perhaps copying an java.io.InputStream to a temporary file etc. ...
>
> Any hints highly appreciated
> -- Wilhelm
>
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html