Login  Register

Re: Read/open image from resource inside a JAR file?

Posted by Burger Wilhelm on Jun 01, 2016; 2:56pm
URL: http://imagej.273.s1.nabble.com/Read-open-image-from-resource-inside-a-JAR-file-tp5016554p5016571.html

Thanks Wayne for this hint, I must have overlooked that plugin when I searched for it.
I am not completely happy with this solution though, since every file/image type is handled individually. Against my initial intentions (and lacking a better idea), I now consider extracting arbitrary resources to temporary files and subsequently load/process them.

--Wilhelm

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rasband, Wayne (NIH/NIMH) [E]
Sent: Mittwoch, 01. Juni 2016 02:19
To: [hidden email]
Subject: Re: Read/open image from resource inside a JAR file?

> On May 31, 2016, at 10:22 AM, Burger Wilhelm <[hidden email]> wrote:
>
> 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. …

The JAR Resources Demo plugin at

    https://imagej.nih.gov/ij/plugins/pcl-demo.html

opens a JPEG image, a TIFF image and a text file contained in a JAR file. It opens the JPEG using a URL and the TIFF using an InputStream.

-wayne


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html