Cannot display images with IIPImage

625 views
Skip to first unread message

Tao Zhao

unread,
Feb 13, 2018, 2:36:48 AM2/13/18
to IIIF Discuss
Running IIPImage in a vagrant box of Centos 7 with spawn-fcgi and Nginx or Apache only.


PalaisDuLouvre.tif is provided by the IIPImage website as an example so it should work fine:



If I use a jpeg file instead it displays:



There should not be any permission issue as I run the web server as root user. Not sure if I am missing anything there.
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Andrew Hankinson

unread,
Feb 13, 2018, 6:05:33 AM2/13/18
to iiif-d...@googlegroups.com
Hi Tao,

Your TIFF files need to be encoded as Pyramid TIFFs. IIP does not support JPEG, only JPEG2000 (these are two different formats). There are instructions on the IIP website for how to create Pyramid TIFFs and JPEG2000 files.

http://iipimage.sourceforge.net/documentation/images/

Cheers,
-Andrew

> On 13 Feb 2018, at 07:36, Tao Zhao <tao.zh...@gmail.com> wrote:
>
> Running IIPImage in a vagrant box of Centos 7 with spawn-fcgi and Nginx or Apache only.
>
>
> PalaisDuLouvre.tif is provided by the IIPImage website as an example so it should work fine:
>
> <Auto Generated Inline Image 1.png>
>
> If I use a jpeg file instead it displays:
>
> <Auto Generated Inline Image 2.png>
>
> There should not be any permission issue as I run the web server as root user. Not sure if I am missing anything there.
>
> --
> -- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "IIIF Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to iiif-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png>

Tao Zhao

unread,
Feb 13, 2018, 11:51:51 AM2/13/18
to IIIF Discuss
Thanks Andrew. I tried but the same error still appears.

The command to convert to pyramid tif: convert PalaisDuLouvre.tif -define tiff:tile-geometry=256X256 'ptif:test2.tif'

But still got the same error. Maybe I should remove the

Auto Generated Inline Image 1

Tao Zhao

unread,
Feb 13, 2018, 12:11:02 PM2/13/18
to IIIF Discuss
Do the file names have to follow some kind of pattern?

David Beaudet

unread,
Feb 14, 2018, 7:05:52 AM2/14/18
to IIIF Discuss

Are you seeing any errors in the IIP log file?  You might need to enable verbosity to say... 5... as well as making sure the iip log file can be written to by the owner of the web server process.

Andrew Hankinson

unread,
Feb 14, 2018, 9:45:33 AM2/14/18
to iiif-d...@googlegroups.com
Unless you have the base directory specified in your settings you have to pass the absolute filepath to the FIF parameter, and the server needs read access to that, e.g.,

example.com/iipsrv.fcgi?FIF=/srv/img/test2.tif

Read access means that you probably can't just store the image in your home directory, since the server process can't see that due to permissions (unless you're running the server as your user.)

-Andrew

> On 13 Feb 2018, at 16:51, Tao Zhao <tao.zh...@gmail.com> wrote:
>
> Thanks Andrew. I tried but the same error still appears.
>
> The command to convert to pyramid tif: convert PalaisDuLouvre.tif -define tiff:tile-geometry=256X256 'ptif:test2.tif'
>
> But still got the same error. Maybe I should remove the
>

Tao Zhao

unread,
Feb 14, 2018, 10:48:12 AM2/14/18
to IIIF Discuss
Log file says:

<----------------------------------->
Tue Feb 13 16:36:26 2018

IIPImage Server. Version 1.0
*** Ruven Pillay <ru...@users.sourceforge.net> ***

Verbosity level set to 1
Running in FCGI mode

Setting maximum image cache size to 10MB
Setting filesystem prefix to ''
Setting default JPEG quality to 75
Setting maximum CVT size to 5000
Setting HTTP Cache-Control header to 'max-age=86400'
Setting 3D file sequence name pattern to '_pyr_'


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


QUERY_STRING not set


QUERY_STRING not set

FIF :: Image cache initialization

QUERY_STRING not set


QUERY_STRING not set


QUERY_STRING not set

Tao Zhao

unread,
Feb 14, 2018, 10:49:15 AM2/14/18
to IIIF Discuss
Tried absolute path but not working.

Thanks.

David Beaudet

unread,
Feb 14, 2018, 11:47:04 AM2/14/18
to iiif-d...@googlegroups.com
Try setting verbosity to something like 5 and see what you get in the logs.

--
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "IIIF Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iiif-discuss/32SVIBmFo7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iiif-discuss+unsubscribe@googlegroups.com.

Tao Zhao

unread,
Feb 14, 2018, 11:56:40 AM2/14/18
to IIIF Discuss

IIPImage Server. Version 1.0
*** Ruven Pillay <ru...@users.sourceforge.net> ***

Verbosity level set to 5

Running in FCGI mode

Setting maximum image cache size to 10MB
Setting filesystem prefix to ''
Setting default JPEG quality to 75
Setting maximum CVT size to 5000
Setting HTTP Cache-Control header to 'max-age=86400'
Setting 3D file sequence name pattern to '_pyr_'


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

Full Request is FIF=/usr/libexec/iipsrv/img/test.tif
[1/1]: Command / Argument is FIF : /usr/libexec/iipsrv/img/test.tif
FIF handler reached
FIF :: URL decoding/filtering: /usr/libexec/iipsrv/img/test.tif => /usr/libexec/iipsrv/img/test.tif
FIF :: Image cache initialization
FIF :: TIFF image detected
FIF :: Created image
FIF :: Image dimensions are 4000 x 828
FIF :: Image contains 3 channels with 8 bits per channel
FIF :: Image timestamp: Tue, 13 Feb 2018 16:51:19 GMT
FIF :: Total command time 1239 microseconds
---
Server: iipsrv/1.0^M
Cache-Control: no-cache^M
Content-Type: application/vnd.netfpx^M
Status: 400 Bad Request^M
Content-Disposition: inline;filename="IIPisAMadGameClosedToOurUnderstanding.netfpx"^M
^M
You received this message because you are subscribed to a topic in the Google Groups "IIIF Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iiif-discuss/32SVIBmFo7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iiif-discuss...@googlegroups.com.

Tao Zhao

unread,
Feb 14, 2018, 11:58:14 AM2/14/18
to IIIF Discuss
The last line of the log file says:

Error/40:2 1 FIF=/usr/libexec/i^M

Andrew Hankinson

unread,
Feb 14, 2018, 12:48:19 PM2/14/18
to iiif-d...@googlegroups.com
You need to include the arguments JTL and CVT.

David Beaudet

unread,
Feb 14, 2018, 1:19:18 PM2/14/18
to iiif-d...@googlegroups.com
Yep, you would need those additional parameters to construct a functional IIP command. If you're trying to use the IIIF image API there is built-in support in IIP for transforming IIIF requests into the proper IIP Image protocol parameters.  The instructions for doing that are on the IIP site which appears to be in the process of being migrated right now so I don't have a link, but if I recall correctly, it basically amounts to using mod_rewrite to transform /iiif/(.*) prefix to an IIP IIIF, e.g. .../iipsrv.fcgi?iiif=$1  -- you could get IIIF going without that but it wouldn't comply to the IIIF image protocol without the mod_rewrite.



--
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "IIIF Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iiif-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "IIIF Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iiif-discuss/32SVIBmFo7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iiif-discuss+unsubscribe@googlegroups.com.

Andrew Hankinson

unread,
Feb 14, 2018, 2:41:47 PM2/14/18
to iiif-d...@googlegroups.com
Our nginx configuration for IIIF in IIP looks like this:

rewrite ^/iiif/image/(.+)$ /fcgi-bin/iipsrv.fcgi?IIIF=$1 last;

You will probably also want the 303 redirect for images with no parameters to the info.json as well:

location ~ ^/iiif/image/([^/]+)$ {
    return 303 $request_uri/info.json;
}

I imagine the settings are very similar for Apache.

-Andrew

-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en

--- 
You received this message because you are subscribed to the Google Groups "IIIF Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iiif-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en
--- 
You received this message because you are subscribed to a topic in the Google Groups "IIIF Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/iiif-discuss/32SVIBmFo7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to iiif-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
-- You received this message because you are subscribed to the IIIF-Discuss Google group. To post to this group, send email to iiif-d...@googlegroups.com. To unsubscribe from this group, send email to iiif-discuss...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/iiif-discuss?hl=en

Tao Zhao

unread,
Feb 15, 2018, 10:52:33 AM2/15/18
to IIIF Discuss
Thank you very much Andrew and David! The IIPImage website is down now. I have to wait until it comes back.

Tao Zhao

unread,
Feb 27, 2018, 12:46:17 PM2/27/18
to IIIF Discuss
Oh Crap! After I wrenching around my nginx baby, it cannot even open the IIPImage server page now:

error.log says: 2018/02/27 17:40:09 [error] 21688#0: *20 connect() failed (111: Connection refused) while connecting to upstream, client: 172.28.128.1, server: _, request: "GET /fcgi-bin/iipsrv.fcgi HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "172.28.128.3"

The nginx.conf file:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location /fcgi-bin/iipsrv.fcgi {
            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;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

Am I missing anything here? Thanks.

Tao Zhao

unread,
Mar 2, 2018, 11:27:35 AM3/2/18
to IIIF Discuss
Got the problem: I should use the ip address instead of localhost.

Tao Zhao

unread,
Mar 2, 2018, 12:04:17 PM3/2/18
to IIIF Discuss
Everything is working now. Thanks!
Reply all
Reply to author
Forward
0 new messages