Menu

The image cannot be displayed because it contains error

Anonymous
2021-01-19
2022-11-04
  • Anonymous

    Anonymous - 2021-01-19

    Hello,

    I've recently installed the latest version of IIPimage (1.1) on Ubuntu 20.04. I've been using the iiifversion with kakadu in it on another server (Debian 8.10) so I was hoping for the transition to be easy but it's not.

    iipimage-server 1.1 is up and running.
    libopenjp2-7 is up and running.

    Here is my config, some of it I left it at default value :

    ScriptAlias /iipsrv/ "/usr/lib/iipimage-server/"
    
    <Directory "/usr/lib/iipimage-server">
       AllowOverride None
       Options +FollowSymLinks +ExecCGI
       Require all granted
    </Directory>
    
    <IfModule mod_rewrite.c>
      <Directory "/var/www/html">
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^iiif/$ /iipsrv/iipsrv.fcgi [L]
        RewriteRule ^iiif/(.+)$ /iipsrv/iipsrv.fcgi?FIF=$1 [L]
      </Directory>
    </IfModule>
    
    <IfModule mod_fcgid.c>
      FcgidConnectTimeout 20
      FcgidIdleTimeout 0
      FcgidMaxProcessesPerClass 4
    
      <IfModule mod_mime.c>
        AddHandler fcgid-script fcg fcgi fpl
      </IfModule>
    
      FcgidInitialEnv LOGFILE "/var/log/iipsrv.log"
      FcgidInitialEnv VERBOSITY "6"
      FcgidInitialEnv JPEG_QUALITY "90"
      FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
      FcgidInitialEnv MAX_CVT "1000"
      FcgidInitialEnv MEMCACHED_SERVERS "localhost"
      FcgidInitialEnv MEMCACHED_TIMEOUT "0"
      FcgidInitialEnv FILESYSTEM_PREFIX "/data/"
      FcgidInitialEnv FILENAME_EXTENSION ".jp2"
    </IfModule>
    

    The FILENAME_EXTENSION doesn't seem to work, even though it was working before.

    This kind of path works :
    http://server/iiif/path_to_image.jp2&wid=1200&cvt=jpeg

    These doesn't but worked fine on the other server :
    http://server/iiif/path_to_image
    /path_to_image is neither a file nor part of an image sequence
    Sending HTTP 404 Not Found

    http://server/iiif/path_to_image.jp2
    Error/109:2 1 FIF=

    http://server/iiif/path_to_image/full/66,/0/default.jpg
    /path_to_image/full/66,/0/default.jpg is neither a file nor part of an image sequence
    Sending HTTP 404 Not Found

    I'm on it for a long time now so I might have missed something obvious, if so I am sorry.
    I hope you can help me in any way :)

     
  • Ruven

    Ruven - 2021-01-19

    FILESYSTEM_SUFFIX was only added recently and is not in version 1.1. It will be available in the future 1.2 release. Though, note that iipsrv can determine the file type of an image without using the suffix, so this functionality is only useful when you have images encoded in multiple formats in the same location. So, it's possible you don't need this.

    The kinds of paths like http://server/iiif/path_to_image.jp2 are technically not valid IIIF. iipsrv should redirect these with a 303 to the correct info.json path.

    Version 1.1 allows you to use iipsrv and IIIF without having to do URL rewriting, so you can remove all the <ifmodule mod_rewrite.c=""> section. Instead you should use the URI_MAP directive to map path prefixes to the IIIF handler. So to use a "iiif" prefix as in your example, simply add this:</ifmodule>

    FcgidInitialEnv   URL_MAP ""iiif=>IIIF""
    

    Try these changes and let me know if it helps.

     
  • Anonymous

    Anonymous - 2021-01-19

    Well, that works, it was that simple !
    But only for images located directly under /data/, is there any way I can go through the directories using IIIF protocol ?
    For example : http://server/iiif/511/0001_001/00002/000_A_0027
    where 000_A_0027 is my image located in /data/511/0001_001/00002/
    We have thousands of these and I can't imagine putting them all in the same directory.

     
  • Anonymous

    Anonymous - 2021-01-20

    Nevermind my last message, mistake on my part :)
    Thank you for the help and the fast reply.

     
  • Ruven

    Ruven - 2021-01-21

    Yes, as you've already worked out yourself, you can point to any sub-directory within whatever you set as your filesystem_prefix, which in your case is /data/

     
  • Anonymous

    Anonymous - 2022-10-27

    Hi,
    Some time has passed and we are changing from apache to nginx.
    Everything works fine but one thing : the URI_MAP parameter.

    This is working : https://myiip.com/iiif/?FIF=image.jp2&wid=2000&cvt=jpeg
    This is not : https://myiip.com/iiif/image.jp2

    I know it is not valid IIIF but it is not the final URL, just a test to see if it is working. On apache, adding the URI_MAP parameter was enough to get rid of the "?FIF=" and "&wid=2000..." parts but not with nginx (or else I'm not doing it correctly).
    The alias is working though :
    server {
    ...
    location /iiif {
    ...
    }
    }
    And as an example, LOGFILE and FILESYSTEM_PREFIX parameters are working as expected :
    ...
    export LOGFILE=/var/log/iipsrv.log
    export FILESYSTEM_PREFIX="/images/"
    export URI_MAP="iiif=>IIIF"
    ...

    Is there maybe something else that I forgot to achieve that ?
    Thanks for helping :)

     
  • Anonymous

    Anonymous - 2022-10-27

    Sorry I forgot to include the content of the log file.
    I skipped some lines to make it shorter.

    https://myiip.com/iiif/?FIF=image.jp2&wid=2000&cvt=jpeg :

    Initialisation Complete.
    <----------------------------------->
    Full Request is FIF=image.jp2&wid=2000&cvt=jpeg
    [1/3]: Command / Argument is FIF : image.jp2
    FIF handler reached
    FIF :: URL decoding/filtering: image.jp2 => image.jp2
    FIF :: Image cache initialization
    FIF :: JPEG2000 image detected
    FIF :: Created image
    FIF :: Image dimensions are 5280 x 3424
    FIF :: Image contains 1 channel with 8 bits per channel
    FIF :: Image timestamp: Thu, 06 Oct 2022 14:41:43 GMT
    FIF :: Total command time 786 microseconds
    [2/3]: Command / Argument is wid : 2000
    WID handler reached
    WID :: requested width is 2000
    [3/3]: Command / Argument is cvt : jpeg
    CVT :: JPEG output
    CVT handler reached
    CVT :: Using resolution 4 with size 2640x1712
    CVT :: No view port set
    CVT :: Requested scaled region size is 2000x1297. Nearest existing resolution is 4 which has region with size 2640x1712
    TileManager getRegion :: requesting region directly from image
    CVT :: Resizing using bilinear interpolation in 13881 microseconds
    ...
    CVT :: Total command time 289845 microseconds
    Memcached :: stored 329637 bytes in 20 microseconds
    Total Request Time: 291245 microseconds
    image closed and deleted
    Server count is 1

    https://myiip.com/iiif/image.jp2 :

    Full Request is FIF=image.jp2
    [1/1]: Command / Argument is FIF : image.jp2
    FIF handler reached
    FIF :: URL decoding/filtering: image.jp2 => image.jp2
    FIF :: Image cache hit. Number of elements: 1
    FIF :: JPEG2000 image detected
    FIF :: Created image
    FIF :: Image dimensions are 5280 x 3424
    FIF :: Image contains 1 channel with 8 bits per channel
    FIF :: Image timestamp: Thu, 06 Oct 2022 14:41:43 GMT
    FIF :: Total command time 363 microseconds


    Server: iipsrv/1.1
    Cache-Control: no-cache
    Content-Type: application/vnd.netfpx
    Status: 400 Bad Request
    Content-Disposition: inline;filename="IIPisAMadGameClosedToOurUnderstanding.netfpx"

    Error/13:2 1 FIF=image.jp2


    Memcached :: stored 219 bytes in 7 microseconds
    Total Request Time: 647 microseconds
    image closed and deleted
    Server count is 2

     
  • Ruven

    Ruven - 2022-11-02

    Which version of iipsrv are you using? Can you send me the beginning of the log file with the initialization information? You should see a line like:

    Setting URI mapping to iiif=>IIIF. Supported protocol: IIIF`

     
  • Anonymous

    Anonymous - 2022-11-03

    Version is 1.1.

    The said line is there, here is the beginning :

    IIPImage Server. Version 1.1
    Ruven Pillay ruven@users.sourceforge.net

    Verbosity level set to 6
    Running in standalone mode on socket: 127.0.0.1:9000 with backlog: 2048

    Setting maximum image cache size to 10MB
    Setting filesystem prefix to '/images/'
    Setting default JPEG quality to 90
    Setting maximum CVT size to 2000
    Setting HTTP Cache-Control header to 'max-age=86400'
    Setting 3D file sequence name pattern to 'pyr'
    Setting Allow Upscaling to true
    Setting ICC profile embedding to true
    Setting up JPEG2000 support via OpenJPEG
    Setting image processing engine to CPU processor
    OpenMP enabled for parallelized image processing with 8 threads
    Setting URI mapping to iiif=>IIIF. Supported protocol: IIIF
    Memcached support enabled. Connected to servers: 'localhost' with timeout 0

     
  • Anonymous

    Anonymous - 2022-11-03

    I don't know if it has to do with anything, but the log file here says that it's running in standalone mode compared to my current working config where it's running in FCGI mode.
    What could trigger that ?

     
  • Ruven

    Ruven - 2022-11-03

    Did you remove the Apache rewrite rules for "iiif"? When you use the iipsrv URI_MAP function, you don't need to do any Apache re-writing, so remove these 2 lines from your Apache config:

    RewriteRule ^iiif/$ /iipsrv/iipsrv.fcgi [L]
    RewriteRule ^iiif/(.+)$ /iipsrv/iipsrv.fcgi?FIF=$1 [L]
    

    However, you do need to let Apache know that requests to /iiif/ should be handled by iipsrv, so add this line:

    ScriptAlias /iiif/ "/usr/lib/iipimage-server/iipsrv.fcgi"

    Now restart Apache and it will hopefully all work!

     
  • Anonymous

    Anonymous - 2022-11-04

    Apache is the config I'm switching from. This is all with nginx.

     
    • Ruven

      Ruven - 2022-11-04

      OK, so your Nginx config should look something like this:

      location /iiif {
          fastcgi_pass    localhost:9000;
          fastcgi_param   PATH_INFO $fastcgi_script_name;
              fastcgi_param   REQUEST_METHOD $request_method;
              fastcgi_param   QUERY_STRING $query_string;
              fastcgi_param   CONTENT_TYPE $content_type;
              fastcgi_param   CONTENT_LENGTH $content_length;
              fastcgi_param   SERVER_PROTOCOL $server_protocol;
              fastcgi_param   REQUEST_URI $request_uri;
              fastcgi_param   HTTPS $https if_not_empty;
      }
      
       

      Last edit: Ruven 2022-11-04
  • Anonymous

    Anonymous - 2022-11-04

    Surprinsigly, that worked. Only the "fastcgi_param REQUEST_URI $request_uri;" was missing from my config. It is textbook from the doc but I completely missed that line.
    Thank you :)

     

Anonymous
Anonymous

Add attachments
Cancel