imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

Opening a URL should ignore query parameters #232

Closed etienne-monier closed 6 months ago

etienne-monier commented 6 months ago

I, I've open a question in the image.sc forum.

(I'm not asking the same question here, but reading this is interesting for this issue comprehension)

I want to open an image whose URL looks like http://host/path/to/picture.png?AWSAccessKeyId=xxxx&Expires=xxx&Signature=xxx, but it opens it in the browser instead of opening it in ImageJ.

It turns out the code looks at the URL string last characters to determine the extension.

On opening with URL, we call

  1. URLOpener.run here which calls
  2. ImagePlus constructor here which calls
  3. Opener.openURL here

The problem is that the URL query parameters should be ignored to evaluate the file extension.

I've never written Java, so I can not help you easily. But I think a stripped URL string should be built to evaluate the extension, then use the full URL to open the file.

imagesc-bot commented 6 months ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/i-cannot-open-an-image-in-the-software-via-its-url/89536/3

etienne-monier commented 6 months ago

Issue closed thanks to replies in forum.