ruven / iipsrv

iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images.
https://iipimage.sourceforge.io
GNU General Public License v3.0
292 stars 115 forks source link

Problem accessing images in subdirectories #266

Closed dgarciabriseno closed 8 months ago

dgarciabriseno commented 8 months ago

I'm running into a problem with how images are organized on my filesystem.

I am running iipsrv via docker docker run -it -p 9000:9000 -p 8080:80 -v $PWD/images:/images iipsrv/iipsrv

I have my images laid out in a particular way year/month/day/type/image.jp2

When I access info.json via this path: http://localhost:8080/iiif/2024/02/11/testing/aia_304.jp2/info.json it works, and I get the json response back.

But accessing the jp2 file at http://localhost:8080/iiif/2024/02/11/testing/aia_304.jp2 I get /images/2024 is neither a file nor part of an image sequence

It seems like the problem is mixing numbers and text, if I move the file to just 2024/02/11/aia_304.jp2 then it works.

Edit: Live example: https://api.beta.helioviewer.org/images/iiif/HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2/info.json

Edit 2, Logs:

Accessing info.json

Request URI mapped to iiif=HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2/info.json
Full Request is iiif=HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2/info.json
[1/1]: Command / Argument is iiif : HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2/info.json
IIIF handler reached
IIIF :: URL decoded to HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2/info.json
FIF handler reached
FIF :: URL decoding/filtering: HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2 => HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
FIF :: Image cache hit. Number of elements: 2
FIF :: JPEG2000 image detected
FIF :: Created image
FIF :: Image dimensions are 4096 x 4096
FIF :: Image contains 1 channel with 8 bits per channel
FIF :: Image timestamp: Sun, 11 Feb 2024 10:03:35 GMT
FIF :: Total command time 865 microseconds
IIIF :: ID is set to https://api.beta.helioviewer.org/images/iiif/HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
Total Request Time: 1408 microseconds
image closed and deleted
Server count is 9

Accessing the jp2

Request URI mapped to iiif=HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
Full Request is iiif=HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
[1/1]: Command / Argument is iiif : HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
IIIF handler reached
IIIF :: URL decoded to HMI/2024/02/11/magnetogram/2024_02_11__07_48_24_100__SDO_HMI_HMI_magnetogram.jp2
FIF handler reached
FIF :: URL decoding/filtering: HMI/2024 => HMI/2024
FIF :: Image cache miss
/images/HMI/2024 is neither a file nor part of an image sequence
Sending HTTP 404 Not Found
Total Request Time: 391 microseconds
image closed and deleted
Server count is 10
dgarciabriseno commented 8 months ago

This is working now, I don't know what I changed :( I had the BASE_URL set incorrectly at first and maybe my browser was caching the result.

ruven commented 8 months ago

Glad it's now working!

Note, however, that IIIF uses slashes to separate region, size, rotation parameters etc, so to avoid confusion when using sub-directories, it's best to URL encode the path name