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
288 stars 114 forks source link

For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. #270

Closed pclmnkenzo closed 11 hours ago

pclmnkenzo commented 1 month ago

For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response.

How can this be prevented this from happening?

ahankinson commented 1 month ago

Do you have a URL or more information on what triggers this behaviour? It's hard to tell what the problem is from your description.

pclmnkenzo commented 1 month ago

Thank you for the quick reaction, Andrew.

For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response

@.***

https://maltalibraries.inforlib.uk/iguana/iiif/image/%5C%5C10.76.136.69%5CDAMAssetsRW%5C5_16750_TIFF%5C6.tif

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Andrew Hankinson @.> Sent: Monday, 15 July 2024 10:40 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; Author @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

Do you have a URL or more information on what triggers this behaviour? It's hard to tell what the problem is from your description.

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2227976058, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPU6Q5CTQSHWNAYZDFLZMODFFAVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXHE3TMMBVHA. You are receiving this because you authored the thread.Message ID: @.**@.>>

ahankinson commented 1 month ago

The ID is constructed from a couple different possible HTTP Headers. Here is the code where this happens:

https://github.com/ruven/iipsrv/blob/master/src/IIIF.cc#L195-L218

This looks like a configuration problem on your end.

The ID can come from the Host header from your proxy, which is what I suspect is happening. I'm going to guess that %%2 is a double-encoding of %20 (i.e., a space character) with some sort of string chomping that restricts it to only 3 characters. So somewhere there is an errant space being added to the Host header.

You can also use the X-IIIF-ID header to explicitly set the ID directly, which bypasses reading the Host header. You could try using that for debugging to see if the problem persists or if it goes away.

ruven commented 1 month ago

Can you copy and paste the section from the iipsrv logfile where this happens? Make sure the verbosity parameter is set to something like 5. What configuration parameters are you using with iipsrv? Copy and paste also the beginning of the logfile which contains the startup parameters.

pclmnkenzo commented 1 month ago

Hi,

Apologies for the small delay as we first tried something else, but were unsuccessful in that.

Below are the settings and the logs:

IIPImage Server. Version 1.2 Ruven Pillay @*.**@*.>>

Verbosity level set to 6 Running in FCGI mode

Setting maximum image cache size to 10MB Setting filesystem prefix to '' Setting filesystem suffix to '' Setting default JPEG quality to 90 Setting default PNG compression level to 1 Setting default WebP compression level to 50 Setting maximum CVT size to 3000 Setting HTTP Cache-Control header to 'max-age=86400' Setting 3D file sequence name pattern to 'pyr' Setting default IIIF Image API version to 2 Setting Cross Origin Resource Sharing to '*' Setting base URL to 'https://maltalibraries.inforlib.uk/iguana/iiif/image/' Setting Allow Upscaling to true Setting ICC profile embedding to true Setting up JPEG2000 support via OpenJPEG Setting image processing engine to CPU processor

Full Request is iiif=%5C%5C10.76.136.69%5CDAMAssetsRW%5C5_16750_TIFF%5CMaltaLogo01.tif%2Finfo.json [1/1]: Command / Argument is iiif : %5C%5C10.76.136.69%5CDAMAssetsRW%5C5_16750_TIFF%5CMaltaLogo01.tif%2Finfo.json IIIF handler reached IIIF :: URL decoded to \10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tif/info.jsonfile://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json FIF handler reached FIF :: URL decoding/filtering: \10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tiffile://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif => \10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tiffile://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif FIF :: Image cache hit. Number of elements: 6 FIF :: TIFF image detected FIF :: Created image FIF :: Image dimensions are 1053 x 1081 FIF :: Image contains 4 channels with 8 bits per channel FIF :: Image timestamp: Mon, 05 Feb 2024 13:05:41 GMT FIF :: Total command time 13194 microseconds IIIF :: ID is set to https://maltalibraries.inforlib.uk/iguana/iiif/image/\\\\10.76.136.69\\DAMAssetsRW\\5_16750_TIFF\\MaltaLogo01.tif%%2https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252 Total Request Time: 13599 microseconds image closed and deleted Server count is 10

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Ruven @.> Sent: Monday, 15 July 2024 16:54 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; Author @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

Can you copy and paste the section from the iipsrv logfile where this happens? Make sure the verbosity parameter is set to something like 5. What configuration parameters are you using with iipsrv? Copy and paste also the beginning of the logfile which contains the startup parameters.

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2228698688, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPUYUKXNV7BSXQHW2JLZMPPCBAVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRYGY4TQNRYHA. You are receiving this because you authored the thread.Message ID: @.**@.>>

ruven commented 1 month ago

Are you using a HTTP_X_IIIF_ID header somewhere? I suspect that this is what is causing the problem.

And there's a lot of strange text in your log file. Is there some auto-formatting going on? Where did this <file: stuff come from in the log file?

IIIF :: URL decoded to \\10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tif/info.json<file://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json>

The following line tells you what is going to go in the ID field. Are you sure this is what you are really seeing in the log file?

IIIF :: ID is set to https://maltalibraries.inforlib.uk/iguana/iiif/image/\\\\10.76.136.69\\DAMAssetsRW\\5_16750_TIFF\\MaltaLogo01.tif%%2<https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252>

pclmnkenzo commented 1 month ago

Good day,

We checked and we are not using a HTTP_X_IIIF_ID header.

Here’s a new (cleaner) log file (something went wrong while copying the previous log file we sent you):

<-----------------------------------> Wed Jul 17 09:07:43 2024

IIPImage Server. Version 1.2 Ruven Pillay @*.**@*.>

Verbosity level set to 6 Running in FCGI mode

Setting maximum image cache size to 10MB Setting filesystem prefix to '' Setting filesystem suffix to '' Setting default JPEG quality to 90 Setting default PNG compression level to 1 Setting default WebP compression level to 50 Setting maximum CVT size to 3000 Setting HTTP Cache-Control header to 'max-age=86400' Setting 3D file sequence name pattern to 'pyr' Setting default IIIF Image API version to 2 Setting Cross Origin Resource Sharing to '*' Setting base URL to 'https://maltalibraries.inforlib.uk/iguana/iiif/image/' Setting Allow Upscaling to true Setting ICC profile embedding to true Setting up JPEG2000 support via OpenJPEG Setting image processing engine to CPU processor

Initialisation Complete. <----------------------------------->

Full Request is iiif=%2F%2F10.76.136.69%2FDAMAssetsRW%2F5_16750_TIFF%2F6.tif%2Finfo.json [1/1]: Command / Argument is iiif : %2F%2F10.76.136.69%2FDAMAssetsRW%2F5_16750_TIFF%2F6.tif%2Finfo.json IIIF handler reached IIIF :: URL decoded to //10.76.136.69/DAMAssetsRW/5_16750_TIFF/6.tif/info.json FIF handler reached FIF :: URL decoding/filtering: //10.76.136.69/DAMAssetsRW/5_16750_TIFF/6.tif => //10.76.136.69/DAMAssetsRW/5_16750_TIFF/6.tif FIF :: Image cache initialization FIF :: TIFF image detected FIF :: Created image FIF :: Image dimensions are 723 x 1024 FIF :: Image contains 3 channels with 8 bits per channel FIF :: Image timestamp: Mon, 05 Feb 2024 13:05:40 GMT FIF :: Total command time 25704 microseconds IIIF :: ID is set to https://maltalibraries.inforlib.uk/iguana/iiif/image///10.76.136.69/DAMAssetsRW/5_16750_TIFF/6.tif%%2https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/6.tif%25%252 Total Request Time: 25965 microseconds image closed and deleted Server count is 1

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Ruven @.> Sent: Wednesday, 17 July 2024 00:10 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; Author @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

Are you using a HTTP_X_IIIF_ID header somewhere? I suspect that this is what is causing the problem.

And there's a lot of strange text in your log file. Is there some auto-formatting going on? Where did this <file: stuff come from in the log file?

IIIF :: URL decoded to \10.76.136.69\DAMAssetsRW\5_16750_TIFF\MaltaLogo01.tif/info.jsonfile://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json<file://10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json%3cfile:/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif/info.json>

The following line tells you what is going to go in the ID field. Are you sure this is what you are really seeing in the log file?

IIIF :: ID is set to https://maltalibraries.inforlib.uk/iguana/iiif/image/\\\\10.76.136.69\\DAMAssetsRW\\5_16750_TIFF\\MaltaLogo01.tif%%2https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252<https://maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252%3chttps:/maltalibraries.inforlib.uk/iguana/iiif/image/10.76.136.69/DAMAssetsRW/5_16750_TIFF/MaltaLogo01.tif%25%252>

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2231905176, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPT2WJMDP23VJZISYGTZMWK2XAVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRHEYDKMJXGY. You are receiving this because you authored the thread.Message ID: @.**@.>>

pclmnkenzo commented 1 month ago

iipsrv.log Attaching the log file also

ruven commented 1 month ago

I'm unable to reproduce this. Could you give me some more info on your setup:

  1. Are you using the official 1.2 release?
  2. What OS are you running this on?
  3. What web server are you using in front of iipsrv
  4. How are you starting iipsrv?
pclmnkenzo commented 1 month ago

Hi,

Please find some answers to your questions below.

  1. Are you using the official 1.2 release? In August 2023, IIPSRV didn’t have a version that worked with Windows server 2019/2022, so we had to build one ourselves from source using Visual Studio, following these instructions: https://iipimage.sourceforge.io/documentation/server/windows. The result worked fine at another site. Question: is the official 1.2 release that came out after August 2023 compatible with Windows server 2019 and higher?

  2. What OS are you running this on? Windows Server 2022

  3. What web server are you using in front of iipsrv Windows IIS

  4. How are you starting iipsrv? Starts with IIS. Or is that not what you were asking for?

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Ruven @.> Sent: Wednesday, 17 July 2024 23:09 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; State change @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

I'm unable to reproduce this. Could you give me some more info on your setup:

  1. Are you using the official 1.2 release?
  2. What OS are you running this on?
  3. What web server are you using in front of iipsrv
  4. How are you starting iipsrv?

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2234298351, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPQ5W5PWMI33UPA3AK3ZM3MO7AVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZUGI4TQMZVGE. You are receiving this because you modified the open/close state.Message ID: @.**@.>>

ruven commented 1 month ago

Question: is the official 1.2 release that came out after August 2023 compatible with Windows server 2019 and higher?

Yes it should be. I suggest you try with the official 1.2 release to see if that makes a difference - it's built using the same instructions you link to. If you find it's not compatible, try building from the latest source code.

The result worked fine at another site.

Are there any differences between the setups at this other site?

pclmnkenzo commented 1 week ago

Good morning,

Apologies for the delay but we have been discussing this issue with InterSystems (the supplier of Caché and IRIS, the database and application server that our application runs under).

We discovered that the id-element in the response gets the trailing %%2 string when the forward slash preceding the info.json is URL-escaped to %2F in version 1.2 of IIPImage.

https://www.maltalibraries.gov.mt/fcgi-bin/iipsrv.fcgi?IIIF=%5C%5C10.76.136.68%5CDAMAssetsRW%5C5_16750_TIFF/7.tif/info.json” “https://www.maltalibraries.gov.mt/fcgi-bin/iipsrv.fcgi?IIIF=%5C%5C10.76.136.68%5CDAMAssetsRW%5C5_16750_TIFF%2F7.tif%2Finfo.json

We get an error when doing the same thing in version 1.0 of IIPImage: “https://bibpro.vub.ac.be/iipsrv/iipsrv.fcgi?IIIF=/installer/images/3_535545_TIFF%2FCAVA_TS_0779_8032_0054_001.tif%2Finfo.json

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Ruven @.> Sent: Friday, 19 July 2024 00:24 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; State change @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

Question: is the official 1.2 release that came out after August 2023 compatible with Windows server 2019 and higher?

Yes it should be. I suggest you try with the official 1.2 release to see if that makes a difference - it's built using the same instructions you link to. If you find it's not compatible, try building from the latest source code.

The result worked fine at another site.

Are there any differences between the setups at this other site?

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2237722829, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPXW5JUFR6HP2DTQZI3ZNA6BPAVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZXG4ZDEOBSHE. You are receiving this because you modified the open/close state.Message ID: @.**@.>>

ruven commented 11 hours ago

Technically, slashes that are part of the IIIF syntax itself should not be URL-escaped in this way (see section 9 of the API docs: https://iiif.io/api/image/3.0/#9-uri-encoding-and-decoding).

Nevertheless, I've just pushed a fix for this here: https://github.com/ruven/iipsrv/commit/0b9b301a0e14b482cf316f5045b15fddefac44f6

Let me know if this resolves your problem.

pclmnkenzo commented 10 hours ago

Thank you so much!

We’re going to check it out asap (but that might not be possible to do anymore before Monday).

Kind regards, Paul

[A white and grey background with black text Description automatically generated] Paul Clemens Director, Software Development Axiell t. +32 (0)2 20 50 03 e. @.**@.> office. Brussels, Belgium company. Axiell Group AB

From: Ruven @.> Sent: Friday, 6 September 2024 16:37 To: ruven/iipsrv @.> Cc: Paul Clemens @.>; State change @.> Subject: Re: [ruven/iipsrv] For some reason, the IIPImage server adds this “%%2” string to the value of the id-element in the info.json response. (Issue #270)

Technically, slashes that are part of the IIIF syntax itself should not be URL-escaped in this way (see section 9 of the API docs: https://iiif.io/api/image/3.0/#9-uri-encoding-and-decoding).

Nevertheless, I've just pushed a fix for this here: 0b9b301https://github.com/ruven/iipsrv/commit/0b9b301a0e14b482cf316f5045b15fddefac44f6

Let me know if this resolves your problem.

— Reply to this email directly, view it on GitHubhttps://github.com/ruven/iipsrv/issues/270#issuecomment-2334206142, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ3VVPW4DFYP7L54QWROW3DZVG4ZDAVCNFSM6AAAAABK4AGW6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUGIYDMMJUGI. You are receiving this because you modified the open/close state.Message ID: @.**@.>>