I'm a little behind on my reading...
On Nov 22, 2005, at 11:14 PM, John Carlson wrote:
> From what I've seen of the Image I/O plugins, they work
> on Files. I am trying to read a 16-bit TIFF through
> a URL that doesn't end in .tif. I can download an
> equivalent Image from the web site, and it displays fine if
> I pass it as a argument to ImageJ.
>
> I believe I am setting the Content-Type to image/tif
>
> I looked through the code, and it looks like it is looking for
> .tif or .TIF at the end of the URL. So if I change
> my URL from
>
>
http://hostname/dv/no_handler/Archive_Image.html?
> image_id=130267&type=tif
>
> to
>
>
http://hostname/dv/no_handler/Archive_Image.html?
> image_id=130267&type=.tif
>
> things start working.
>
> I guess my request would be that ImageJ look at the
> Content-Type instead of relying on an extension in the URL.
> There are several Content-Types for TIFF.
>
> The change would be in Opener.java, in the openURL
> method.
>
> As it is, my ImageJ applet hanging, and I have to kill it and my
> browser.
>
> I will pursue adding the . to my code
For what it's worth, I (unintentionally) worked around the problem with
code like this:
URL getImage = new URL(sliceURL);
URLConnection c1 = getImage.openConnection();
c1.setRequestProperty("Cookie", cookie);
InputStream is = c1.getInputStream();
ImagePlus imp = new Opener().openTiff(is, title);
In other words, I get an input stream on a URL, then call
Opener.openTiff() on that. I did it this way because I needed to add a
cookie header to the request, but this also got me around the
file-extension problem. (My URLs are of the form
http://hostname/app/civmastiff3d?count=1&slice=99 .)
--
-jeffB (Jeff Brandenburg, Duke Center for In-Vivo Microscopy)