bodleian / iipsrv-openjpeg-docker

A Dockfile deployment of IIP image server 1.0 with OPENJPEG 2.1
MIT License
8 stars 5 forks source link

unsupported image type #2

Open kepper opened 8 years ago

kepper commented 8 years ago

It seems like the official sample image is not loading correctly. A request to http://localhost/fcgi-bin/iipsrv.fcgi?IIIF=67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg doesn't work as expected. The logs tell the following:

Full Request is IIIF=67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg
[1/1]: Command / Argument is IIIF : 67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg
IIIF handler reached
IIIF :: URL decoded to 67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg
FIF handler reached
FIF :: URL decoding/filtering: 67352ccc-d1b0-11e1-89ae-279075081939.jp2 => 67352ccc-d1b0-11e1-89ae-279075081939.jp2
FIF :: Image cache initialization

Unsupported image type: 67352ccc-d1b0-11e1-89ae-279075081939.jp2

Total Request Time: 377 microseconds
image closed and deleted
Server count is 15

When validating the file, I get the following output:

[1] test id_error_escapedslash PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/a/b/full/full/0/default.jpg']
  tests: ['status']

[2] test jsonld FAIL
  url: []
  got: text/html
  expected: application/ld+json
  type: json-ld
[3] test region_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/zauwa:/full/0/default.jpg']
  tests: ['status']

[4] test baseurl_redirect PASS
  url: []
  tests: ['redirect']

[5] test id_error_unescaped PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/[frob]/full/full/0/default.jpg']
  tests: ['status']

[6] test size_region FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/0,400,100,100/52,52/0/default.jpg']
  got: 400
  expected: 200
  type: status
[7] test size_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/aETY0V/0/default.jpg']
  tests: ['status']

[8] test size_ch FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/,698/0/default.jpg']
  got: 400
  expected: 200
  type: status
[9] test size_wc FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/500,/0/default.jpg']
  got: 400
  expected: 200
  type: status
[10] test id_squares FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg']
  got: 400
  expected: 200
  type: status
[11] test region_pixels FAIL
  exception: cannot identify image file <StringIO.StringIO instance at 0x7fae26c48ab8>

Traceback (most recent call last):
  File "/tmp/iiif-validator-1.0.0/iiif-validate.py", line 70, in <module>
    testSuite.run_test(testname, result)
  File "/tmp/iiif-validator-1.0.0/iiif_validator/validator.py", line 126, in run_test
    return test.run(result)
  File "/tmp/iiif-validator-1.0.0/iiif_validator/tests/region_pixels.py", line 22, in run
    img = result.get_image(params)
  File "/tmp/iiif-validator-1.0.0/iiif_validator/validator.py", line 318, in get_image
    img = self.make_image(imgdata)
  File "/tmp/iiif-validator-1.0.0/iiif_validator/validator.py", line 312, in make_image
    img = Image.open(imgio)
  File "/usr/local/lib/python2.7/dist-packages/PIL/Image.py", line 2309, in open
    % (filename if filename else fp))
IOError: cannot identify image file <StringIO.StringIO instance at 0x7fae26c48ab8>

[12] test id_escaped FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc%2Dd1b0%2D11e1%2D89ae%2D279075081939.jp2/full/full/0/default.jpg']
  got: 400
  expected: 200
  type: status
[13] test format_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.@gm']
  tests: ['status']

[14] test info_json FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/info.json']
  got: 400
  expected: 200
  type: status
[15] test size_percent FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/pct:58/0/default.jpg']
  got: 400
  expected: 200
  type: status
[16] test cors FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/info.json']
  got: 
  expected: *
  type: CORS
[17] test id_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/29a6d360-65ef-11e6-b633-0242ac110002/full/full/0/default.jpg']
  tests: ['status']

[18] test quality_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/qH6CWy.jpg']
  tests: ['status']

[19] test format_jpg FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg']
  got: 400
  expected: 200
  type: status
[20] test id_basic FAIL
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/0/default.jpg']
  got: 400
  expected: 200
  type: status
[21] test rot_error_random PASS
  url: ['http://localhost:80/fcgi-bin/iipsrv.fcgi?IIIF=/67352ccc-d1b0-11e1-89ae-279075081939.jp2/full/full/YsC>/default.jpg']
  tests: ['status']

Done (21 tests, 12 failures)

What am I doing wrong?

cdekok commented 7 years ago

I am having the same issue. It's because of it uses a old fork of IIP

Change

RUN git clone https://github.com/uclouvain/openjpeg.git ./
RUN git checkout tags/version.2.1

To

git clone https://github.com/ruven/iipsrv.git

See: https://gist.github.com/cdekok/5844aad11cec3ce624147788c688c4f5