Thanks Albert
I'll give that a try tonight!
Nick
-----Original Message-----
From: ImageJ Interest Group on behalf of Albert Cardona
Sent: Fri 3/2/2007 4:07 AM
To:
[hidden email]
Cc:
Subject: Re: Reading JPegs from a ZIP file
Hi Nick,
> I'm looking for a way of opening a jpeg from a zip file in a plug in
>
> ZipEntry zipEntry = zidFile.getEntry(directory+fileName);
> opener.openTiff(zidFile.getInputStream(zipEntry),fileName);
>
> somthing like this but for Jpegs
>
From the java API, class java.awt.Toolkit:
|*createImage
<cid:
[hidden email]>*(byte[] imagedata)|
Creates an image which decodes the image stored in the
specified byte array.
The above understands jpegs. Just put your
zidFile.getInputStream(zipEntry) into a ByteArrayOutputStream, and then
handle the byte[] to the above Toolkit.createImage method.
Albert