GithubHelp home page GithubHelp logo

iiif / image-validator Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 20.0 743 KB

Validator for the Image API

Home Page: http://iiif.io/api/image/validator/

License: Apache License 2.0

Python 85.13% CSS 1.47% HTML 4.80% JavaScript 7.19% Dockerfile 1.41%

image-validator's People

Contributors

azaroth42 avatar glenrobson avatar greut avatar hugovk avatar jronallo avatar ruven avatar zimeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

image-validator's Issues

Auto fix ELB when application in Severe

It would be useful to deploy a new version of the application if it is in Severe state for a period of time. Ideally it would keep the old version around for debugging...

Suggested in #80

Should validator also send preflight OPTIONS request?

Related to #33, should the validator also send OPTIONS to potentially prime the way for the actual CORS request? Or does no system really take this into account? Or is this testing CORS and not IIIF?
Note that the spec and apache implementation note don't mention it.

problem with iiif validator version 1.0.4: module image not found

Hi

I had a problem when running iiif validator version 1.0.4 (MacOS Sierra): "ModuleNotFoundError: No module named 'Image'"

For details, please see: dasch-swiss/sipi#215 (comment)

Updating Pillow to Pillow (4.3.0) fixed the issue: "pip3 install --upgrade pillow"

However, this was not obvious to me. If found this post that helped me fix the issue: https://stackoverflow.com/questions/42317641/pil-library-not-loaded-opt-local-lib-libjpeg-9-dylib

greets

Tobias

Validator should report when it can't parse JSON

BL JSON for 2.0 was not valid JSON, but the error message was that it was missing width. This is because the try/except block returns a {} instead of an error condition. This should be reported early rather than falling through.

Unfairly FAILING the size_noup test?

I would like to inquire whether the size_noup test maybe is unfairly failing?

Example for our own IIIF Image API 3.0:
https://lbiiif.riksarkivet.se/v3/arkis!B0000998_00014/info.json (version 3, level1)

https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Flbiiif.riksarkivet.se&prefix=%2Fv3%2F&identifier=arkis%21B0000998_00014&version=3.0&level=-1&id_basic=on&size_noup=on

Test result:

Size greater than 100% should only work with the ^ notation
Elapsed time (ms): 1842
url: https://lbiiif.riksarkivet.se/v3/arkis!B0000998_00014/full/1881,1881/0/default.jpg
got: 200
expected: !200
type: size-upscalling
message: Retrieving upscailed image succeeded but should have failed as 3.0 requires the ^ for upscalling. Size: 1881,1881
warning: false

HOWEVER,

max size for this image is 2577 x 4339, see even: https://lbiiif.riksarkivet.se/v3/arkis!B0000998_00014/full/max/0/default.jpg
So, validation against "Size greater than 100%" does not seem to be correct.

Of course, download of an image with full region and a size with values like the ones above (1881,1881) retrieves a squared image and therefore a distorted image as the aspect ratio is changed. But we do NOT understand why the validator issues a fail for "Size greater than 100%", as this size is not exceeded.

Support for feature "sizeUpscaling" (Syntax: ^size) is optional according to https://iiif.io/api/image/3.0/compliance/#32-size
We have NOT added any implementation for it, but throw errors. For instance, according to https://iiif.io/api/image/3.0/#42-size - a request of https://lbiiif.riksarkivet.se/v3/arkis!B0000998_00014/full/%5Emax/0/default.jpg results in a 501 - Not Implemented error:
"Size parameter upscaling with '^' is not implemented".

We have tried to compare with other organizations and have found that the same issue arises for their respective IIIF Image API implementations.

For instance,
https://digital.bodleian.ox.ac.uk/developer/iiif/#tag/Image
https://digital.bodleian.ox.ac.uk/developer/iiif/#tag/Image/paths/~1iiif~1image~1{image_id}~1{region}~1{size}~1{rotation}~1{quality}.{format}/get
with the image URI that is given as an example in the documentation, results in a FAIL for size_noup test:

Size greater than 100% should only work with the ^ notation
Elapsed time (ms): 1076
url: https://iiif.bodleian.ox.ac.uk/iiif/image/1363b336-260d-4f22-a6cf-4e1320dbb689/full/1177,1177/0/default.jpg
got: 200
expected: !200
type: size-upscalling
message: Retrieving upscailed image succeeded but should have failed as 3.0 requires the ^ for upscalling. Size: 1177,1177
warning: false

However, the max size image is larger (3734 x 4000): https://iiif.bodleian.ox.ac.uk/iiif/image/1363b336-260d-4f22-a6cf-4e1320dbb689/full/max/0/default.jpg

We would be very grateful for any comments and/or hints regarding the question of how to proceed from here.
Thank you so much.

jsonld validation test should allow charset?

My image server is currently failing validation on the jsonld test. Should it be valid to allow a charset to be set along with the content-type? This is the output:

[2] test jsonld FAIL
  url: []
  got: application/ld+json; charset=utf-8
  expected: application/ld+json
  type: json-ld

Image Validator DOWN - 17th December 2019

Reported by Régis:

" The parameters seem to be ok, but the process end up with a blank page. The url is https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Fccj-iiif.huma-num.fr&prefix=iiif%2Fimage&identifier=JP2%2F67352ccc-d1b0-11e1-89ae-279075081939.jp2&version=2.0&level=1"

Following the link results in a blank page with just the title and a Return to Validator link. Going to the validator page:

https://iiif.io/api/image/validator/

it doesn't list the available tests and checking:

http://image-validator.iiif.io

you get a blank screen. So I think the image validator Elastic Beanstalk service is down.

Region specified by pixels validation test fails due to color error (applies to v2 and v3)

We get a Region specified by pixels test fail like so.

V2 validation:
https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Flbiiif.riksarkivet.se&prefix=%2Fv2%2F&identifier=arkis%2130002046_00011&version=2.0&level=-1&id_basic=on&region_pixels=on

Region specified by pixels
Elapsed time (ms): 2946
url: https://lbiiif.riksarkivet.se/v2/arkis!30002046_00011/313,713,74,74/full/0/default.jpg,https://lbiiif.riksarkivet.se/v2/arkis!30002046_00011/113,413,74,74/full/0/default.jpg,https://lbiiif.riksarkivet.se/v2/arkis!30002046_00011/813,313,74,74/full/0/default.jpg,https://lbiiif.riksarkivet.se/v2/arkis!30002046_00011/513,213,74,74/full/0/default.jpg,https://lbiiif.riksarkivet.se/v2/arkis!30002046_00011/713,113,74,74/full/0/default.jpg
got: Expected 0 for color; Got: 1
expected: No error
type: General error
message: Failed to check size due to: Expected 0 for color; Got: 1
warning: false

Other example:
https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Fiiif.bodleian.ox.ac.uk&prefix=%2Fiiif%2Fimage%2F&identifier=daf51525-07c5-43ca-ac63-4e3060694572&version=2.0&level=1&id_basic=on&id_squares=on&info_json=on&id_error_escapedslash=on&id_error_random=on&id_error_unescaped=on&id_escaped=on&region_error_random=on&region_pixels=on&size_ch=on&size_error_random=on&size_percent=on&size_region=on&size_wc=on&rot_error_random=on&quality_error_random=on&format_jpg=on&format_error_random=on&baseurl_redirect=on&cors=on&jsonld=on

Region specified by pixels
Elapsed time (ms): 2071
url: https://iiif.bodleian.ox.ac.uk/iiif/image/daf51525-07c5-43ca-ac63-4e3060694572/713,213,74,74/full/0/default.jpg,https://iiif.bodleian.ox.ac.uk/iiif/image/daf51525-07c5-43ca-ac63-4e3060694572/13,513,74,74/full/0/default.jpg,https://iiif.bodleian.ox.ac.uk/iiif/image/daf51525-07c5-43ca-ac63-4e3060694572/13,513,74,74/full/0/default.jpg,https://iiif.bodleian.ox.ac.uk/iiif/image/daf51525-07c5-43ca-ac63-4e3060694572/513,213,74,74/full/0/default.jpg,https://iiif.bodleian.ox.ac.uk/iiif/image/daf51525-07c5-43ca-ac63-4e3060694572/113,313,74,74/full/0/default.jpg
got: Expected 0 for color; Got: 1
expected: No error
type: General error
message: Failed to check size due to: Expected 0 for color; Got: 1
warning: false

V3 validation:
https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Flbiiif.riksarkivet.se&prefix=%2Fv3%2F&identifier=arkis%2130002046_00011&version=3.0&level=-1&id_basic=on&region_pixels=on

Region specified by pixels
Elapsed time (ms): 3001

url: https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/713,813,74,74/max/0/default.jpg,https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/813,713,74,74/max/0/default.jpg,https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/713,313,74,74/max/0/default.jpg,https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/813,513,74,74/max/0/default.jpg,https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/913,813,74,74/max/0/default.jpg
got: Expected 0 for color; Got: 1
expected: No error
type: General error
message: Failed to check size due to: Expected 0 for color; Got: 1
warning: false

As the error is color related, but default is tested as quality value, we would like to ask for more information as to what might be wrong in our implementation. Any other hints / suggestions on how to get rid of this FAIL?

Or might the FAIL be an unfair FAIL?

Maybe the threshold (6) used for comparing color differences (abs(col[i] - truth[i]) < 6) is too strict or too lenient depending on the nature of the images being tested? Can adjusting this threshold potentially improve the test's accuracy?

Please comment. Any suggestions are welcome. Thank you.

Validator sends double encoded URI

(I'm just validating against Apache on my laptop, which will likely be unplugged when you read this, so you'll have to trust me :-) )

http://ltopstroop2.princeton.edu/loris/67352ccc%2Dd1b0%2D11e1%2D89ae%2D279075081939.jp2/full/full/0/default.jpg

(hyphens escaped) works as expected. However, the validator fails with:

Escaped characters processed
Elapsed time (ms): 410
url: http://ltopstroop2.princeton.edu/loris/67352ccc%252Dd1b0%252D11e1%252D89ae%252D279075081939.jp2/full/full/0/default.jpg
expected: 200
got: 404
type: status
So, it looks like there some double escaping happening. I may be able to have Loris do, e.g.:

unquote(unquote('67352ccc%252Dd1b0%252D11e1%252D89ae%252D279075081939.jp2'))
'67352ccc-d1b0-11e1-89ae-279075081939.jp2'
but I wonder if that's what you intended? Am I missing something?

Validator should include a tests using a non-square image to test for x,y transposition errors etc.

Suggested by Jeremy Echols on iiif-discuss

Yes, I did use the validator. I found it to be EXTREMELY helpful, actually, as I was previously just kind of testing and hoping :)

There was only one issue I noticed - the test image is square, so it didn't catch a bug I had made in resizing where I had accidentally swapped width and height. It might be helpful to have a test image that isn't a perfect square, but I don't know how often such a stupid bug is likely to hit others, so it may be more time to do that than it's worth

I notes that having a non-square image also will allow checking that the direction of rotation is correct and that the axis for mirroring is correct.

Odd behaviour with the validator test image and certain JPEG 2000 codecs

We noticed severe image corruption decoding the validator test image (http://iiif.io/api/image/validator/67352ccc-d1b0-11e1-89ae-279075081939.jp2) at certain resolutions using the Aware codec. Attempting to decode it using OpenJPEG works but throws some validation errors:

cadams@ganymede:~/Downloads $ j2k_dump -i 67352ccc-d1b0-11e1-89ae-279075081939.jp2 
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (0) than number of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (1) than number of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (2) than number of tile-parts (0)
[WARNING] SOT marker inconsistency in tile 0: tile-part index greater (3) than number of tile-parts (0)

I think the answer for us is simply going to be using the PNG version but it might be worth seeing whether the stock JP2 can be updated in case anyone else runs into this.

Example URL: http://tile.loc.gov/image-services/iiif/service:project1:67352ccc-d1b0-11e1-89ae-279075081939/400,500,50,50/full/0/default.jpg

Example image:

example-corrupt-50x50

Server down

Image validator was unresponsive this morning around 7. It was picked up by the URLCheckError function and a restart seems to have fixed it.

There was no indication of an error from the ElasticBeanstalk instance. Even after fix every other request is quite slow but does return a result...

Missing test: Non 90 rotations

Validator should test non 90 rotations by doing the calculations for where the center of a given square should end up, as per the implementation note in the Image API

Pillow >= 4.0.0 vs python 2.6 -- pick one

We can't use the current major version of Pillow (>= 4.0.0) if we still want to support python 2.6 because Pillow v4 drops support. #49 tied pillow to < 4.0.0 but at some stage we should probably drop python 2.6 support -- but this might cause problems for folks with older RedHat/CentOS VMs.

Validator should be able to validate all HTTPS image servers

I'll submit a pull request with a potential quick fix for this, but the validator does not seem to work with at least some HTTPS image servers because it has not context to verify the peer. Adding ssl and an unverified context works around this.

Validator returns 500 instead of 404

On the live version the validator is returning 500 rather than a 404 for the following (including call counts:

 1 /. 500
   1 /Nmap/folder/check1536524256 500
   1 /Nmap/folder/check1536828751 500
   1 /Yealink-T28P/Y000000000000.cfg 500
   1 /Yealink-T28P/Y000000000005.cfg 500
   1 /Yealink-T28P/Y000000000007.cfg 500
   1 /Yealink/T28P/y000000000000.cfg 500
   1 /Yealink/T28P/y000000000004.cfg 500
   1 /Yealink/T28P/y000000000005.cfg 500
   1 /Yealink/T28P/y000000000007.cfg 500
   1 /YealinkT28P/Y000000000000.cfg 500
   1 /YealinkT28P/Y000000000005.cfg 500
   1 /YealinkT28P/Y000000000007.cfg 500
   1 /dms/Yealink-T28P/Y000000000000.cfg 500
   1 /dms/Yealink-T28P/Y000000000005.cfg 500
   1 /dms/Yealink-T28P/Y000000000007.cfg 500
   1 /dms/Yealink/T28P/y000000000000.cfg 500
   1 /dms/Yealink/T28P/y000000000004.cfg 500
   1 /dms/Yealink/T28P/y000000000005.cfg 500
   1 /dms/Yealink/T28P/y000000000007.cfg 500
   1 /dms/YealinkT28P/Y000000000000.cfg 500
   1 /dms/YealinkT28P/Y000000000005.cfg 500
   1 /dms/YealinkT28P/Y000000000007.cfg 500
   1 /evox/about 500
   1 /p/m/a/scripts/setup.php 500
   1 /phpMyAdmin-2.10.0/scripts/setup.php 500
   1 /phpmyadm1n/index.php 500
   1 /polycom/000000000000.cfg 500
   1 /v/index.php 500
   1 /webdb/scripts/setup.php 500
   1 /yealink/T41P/y000000000036.cfg 500
   1 [13/Sep/2018:09:12:08 "GET
   2 "GET HTTP/1.1"
   2 +0000] /region_pixels?version=2.0&server=api.bl.uk&prefix=image%2Fiiif&identifier=ark%3A%2F81055%2Fvdc_100038478811.0x000001&t=1534464000000
   2 /YealinkT28P/Y000000000004.cfg 500
   2 /data/admin/ver.txt 500
   2 /data/admin/verifies.txt 500
   2 /dms/YealinkT28P/Y000000000004.cfg 500
   2 /graphs/ 500
   2 /myAdmin/scripts/setup.php 500
   2 /mysqladmin/scripts/setup.php 500
   2 /phpmanager/scripts/setup.php 500
   2 /sdk 500
   2 /sqladm/scripts/setup.php 500
   2 /v3.0/web/assets/css/site.css 500
   3 /1hou.php 500
   3 /english/ 500
   3 /mysql/scripts/setup.php 500
   3 /user/register/ 500
   4 /.well-known/security.txt 500
   4 /1.php 500
   4 /2.php 500
   4 /phpAdmin/index.php 500
   4 /phpMyAdmin/scripts/db___.init.php 500
   4 /phpmyadmin/scripts/db___.init.php 500
   4 /qaz.php 500
   4 /tomcat.php 500
   4 /uuu.php 500
   5 /MyAdmin/scripts/setup.php 500
   5 /blog//wp-login.php 500
   5 /myadmin/scripts/setup.php 500
   6 /pc/account/login.aspx 500
   6 /pma/scripts/setup.php 500
   6 /wordpress//wp-login.php 500
   6 /wp//wp-login.php 500
   8 /scripts/setup.php 500
  12 /phpMyAdmin/scripts/setup.php 500
  14 /phpmyadmin/scripts/setup.php 500
  16 /caonma.php 500
  16 /qw.php 500
  17 /ss.php 500
  17 /wcp.php 500
  19 /l6.php 500
  20 /boots.php 500
  20 /miao.php 500
  20 /she.php 500
  22 /manager/html 500
  23 /myadmin2/index.php 500
  23 /mysqladmin/index.php 500
  23 /phpMyAdmin/index.php 500
  23 /phpmyadmin/index.php 500
  23 /phpmyadmin2/index.php 500
  23 /pmd/index.php 500
  23 /tools/phpMyAdmin/index.php 500
  23 /web/phpMyAdmin/index.php 500
  24 /PMA/index.php 500
  24 /PMA2/index.php 500
  24 /admin/PMA/index.php 500
  24 /admin/index.php 500
  24 /admin/mysql/index.php 500
  24 /admin/mysql2/index.php 500
  24 /admin/phpMyAdmin/index.php 500
  24 /admin/phpmyadmin/index.php 500
  24 /admin/phpmyadmin2/index.php 500
  24 /admin/pma/index.php 500
  24 /claroline/phpMyAdmin/index.php 500
  24 /db/index.php 500
  24 /dbadmin/index.php 500
  24 /myadmin/index.php 500
  24 /mysql-admin/index.php 500
  24 /mysql/index.php 500
  24 /phpMyAdmin.old/index.php 500
  24 /phpMyAdmin/phpMyAdmin/index.php 500
  24 /phpMyAdminold/index.php 500
  24 /phpMyadmin_bak/index.php 500
  24 /phpadmin/index.php 500
  24 /phpma/index.php 500
  24 /phpmyadmin-old/index.php 500
  24 /phpmyadmin/phpmyadmin/index.php 500
  24 /phpmyadmin0/index.php 500
  24 /phpmyadmin1/index.php 500
  24 /pma-old/index.php 500
  24 /pma/index.php 500
  24 /pmamy/index.php 500
  24 /pmamy2/index.php 500
  24 /typo3/phpmyadmin/index.php 500
  24 /www/phpMyAdmin/index.php 500
  24 /xampp/phpmyadmin/index.php 500
  27 /zshmindex.php 500
  27 /zuoindex.php 500
  28 /ceshi.php 500
  28 /linuxse.php 500
  28 /xz.php 500
  29 /app.php 500
  29 /default.php 500
  29 /help.php 500
  29 /hh.php 500
  29 /python.php 500
  29 /sean.php 500
  29 /tiandi.php 500
  30 /9510.php 500
  30 /aaaa.php 500
  30 /angge.php 500
  30 /aw.php 500
  30 /m.php?pbid=open 500
  30 /wc.php 500
  30 /xshell.php 500
  30 /xw1.php 500
  30 /yao.php 500
  30 /yumo.php 500
  31 /12.php 500
  31 /1213.php 500
  31 /3.php 500
  31 /56.php 500
  31 /9678.php 500
  31 /ak.php 500
  31 /ak47.php 500
  31 /ak48.php 500
  31 /aotu.php 500
  31 /bak.php 500
  31 /cainiao.php 500
  31 /cmd.php 500
  31 /conflg.php 500
  31 /data.php 500
  31 /db__.init.php 500
  31 /db_dataml.php 500
  31 /db_desql.php 500
  31 /defect.php 500
  31 /fack.php 500
  31 /feixiang.php 500
  31 /h1.php 500
  31 /hm.php 500
  31 /infoo.php 500
  31 /ip.php 500
  31 /l7.php 500
  31 /l8.php 500
  31 /lindex.php 500
  31 /log.php 500
  31 /min.php 500
  31 /mx.php 500
  31 /mz.php 500
  31 /pe.php 500
  31 /phpStudy.php 500
  31 /phpinfi.php 500
  31 /phpstudy.php 500
  31 /post.php 500
  31 /qwe.php 500
  31 /ssaa.php 500
  31 /system.php 500
  31 /wan.php 500
  31 /wanan.php 500
  31 /webdav/ 500
  31 /webslee.php 500
  31 /weixiao.php 500
  31 /wp-admins.php 500
  31 /wshell.php 500
  31 /xiao.php 500
  31 /xiaoma.php 500
  31 /xiaomae.php 500
  31 /xiaomar.php 500
  31 /zuo.php 500
  31 /zuoshou.php 500
  33 /db.init.php 500
  33 /db_session.init.php 500
  34 /w.php 500
  35 /sheep.php 500
  35 /wuwu11.php 500
  35 /xw.php 500
  41 /js/czjl.js 500
  46 /test.php 500
  52 /qaq.php 500
  55 /s.php 500
  62 /q.php 500
  64 /xx.php 500
 121 /qq.php 500
 892 / 500

Unfairly Failing the cors test?

I am trying to write a compliant flask service.
I fail many test's were my understanding is I should not.

As I debug through chrome this what I get when asking for info.json:

HTTP/1.1 200 OK
Server: Werkzeug/2.2.3 Python/3.11.5
Date: Mon, 11 Mar 2024 12:07:05 GMT
Content-Type: application/ld+json
Content-Length: 298
Access-Control-Allow-Origin: *
Connection: close

And this is what I get when asking for the actual image:

HTTP/1.1 200 OK
Server: Werkzeug/2.2.3 Python/3.11.5
Date: Mon, 11 Mar 2024 12:17:26 GMT
Content-Type: image/jpeg
Content-Length: 870044
Cache-Control: no-cache
Date: Mon, 11 Mar 2024 12:17:26 GMT
Access-Control-Allow-Origin: *
Connection: close

Yet the testcase on the cli gives me:

test cors FAIL
  url: ['http://localhost:4000/iiif/caf5f770c38679680655f538ae3b3438/info.json']
  got: http://iiif.io/
  expected: *
  type: CORS
  message: 
  Is Warning?: False

The URL http://iiif.io/ does not exist anywhere in my code.
And is only contained as a super string for the info.json generating dictionary:

tecnical_properties = {
        "@context": "http://iiif.io/api/image/3/context.json",
        "id":img_url,
        "type": "ImageService3",
        "protocol": "http://iiif.io/api/image",
        "profile": "level2",
        "width": image.size[0],
        "height": image.size[1],
        "maxWidth": global_max_width,
        "maxHeight": global_max_height,
        "maxArea": global_max_width * global_max_height, # FOR NOW THIS HAS TO BE THE PRODUCT OF maxWidth and maxHeight
    }

I am running on localhost although I think this should not mater.

Missing test: positions < 0

The validator should test that the server errors when asked for positions less than 0,0, and greater than width,height.

help understanding validator output

Sorry for the absolute-newbie question.
This is just about interpretation of image-validator output, but let me explain (you might have suggestions for solving my real problem connecting a particular IIIF client-server combination).

I have been using for several years a iipmooviewer+iipsrv+IIP protocol combination in a LAN.
I am really happy with how that combination works in our lab, but we want to open our images to public access 24/7 and my institution servers infraestructure is simply not enough.

So I am planning to use Zenodo instead, as its api is supposed to provide IIIF endpoints for stored images.
As iipmooviewer is also supposed to be IIIF-compatible, I'd like to keep using it as a client to Zenodo server.
But there is still an open iipmooviewer issue about that particular client-server combination (if anyone can help your comments are indeed very welcome!!).

There have been no updates in iipmooviewer for the last couple of years, and almost no participation in issues during the last 6-7 years, so I am a bit lost. I don't really know whether the issue is a wrong implementation of IIIF protocol by either iipmooviewer-client and/or zenodo-server, or perhaps they just simply use different (but correct) versions of the protocol.

I guess the first thing to do is checking whether the Zenodo served images' IIIF endpoint is correct.
So I tried to use the validator here: https://iiif.io/api/image/validator
And covered the form for this example image I got from a zenodo public record:
https://zenodo.org/api/iiif/record:7354162:DSCF0021.JPG/info.json

  • Server: https://zenodo.org
  • Prefix: /api/iiif/
  • Image ID: record:7354162:DSCF0021.JPG

I left the defaults for the remaining data:

  • Version: Version 2.0
  • Level: Level 1 - recommended
  • etc.

I passed the above parameters and this is the image-validator output.

I see "green messages" for some items, but many other "red messages" which I don't fully understand.

  • Do they mean Zenodo is using a wrong IIIF implementation (so I should open an issue at zenodo)?
  • Or perhaps I am just using a wrong Version for this server? (I saw several 'image/2' substrings in info.json so I supposed I should check against that version)
  • Maybe Level 1 is too strict choice?

Thanks a lot in advance for your help
@abubelinha

Travis is unhappy because of bottle reference

The cron build for all python versions failed with:

Obtaining bottle from git+https://github.com/bottlepy/[email protected]#egg=bottle (from -r /home/travis/build/IIIF/image-validator/.tox/requirements-dev.txt (line 1))
Cloning https://github.com/bottlepy/bottle (to revision release-0.12) to ./.tox/py35-dev/src/bottle
Did not find branch or tag 'release-0.12', assuming revision or ref.
error: pathspec 'release-0.12' did not match any file(s) known to git.
Command "git checkout -q release-0.12" failed with error code 1 in /home/travis/build/IIIF/image-validator/.tox/py35-dev/src/bottle
ERROR: InvocationError for command '/home/travis/build/IIIF/image-validator/.tox/py35-dev/bin/pip install -r /home/travis/build/IIIF/image-validator/.tox/requirements-dev.txt' (exited with code 1)

see, e.g. https://travis-ci.org/IIIF/image-validator/jobs/457299187

Problem with prefix/identifier in 'id_basic' test

I'm facing a strange behavior with the Image API validator : it seems the "id_basic" test (the third one) always checks the same image identifier. I've made several tests with different images, on different browsers and computers, with different IIIF endpoints (1.1 and 2.0, at Biblissima and Princeton), but each time it tries to check this URI "http://{iiif_base_uri}/loris2/T0000018.jp2/full/full/0/default.jpg". It behaves as if the validator had stored the string "loris/T0000018.jp2" in a cache at some point and thereafter never updated it.

2 examples from Biblissima test endpoint (that uses Loris 2... but there is exactly the same behavior with 1.1 endpoint like Princeton):


capture d ecran 2014-08-18 a 17 14 49

404 and 403 means almost the same for slash identity

For some implementation, the web server's response to slash identity is hard to change. So is it possible to also tolerant 403?

Forward slash gives 404
Elapsed time (ms): 3684
url: http://iiif.etu.huiyouwenhua.com/image/a/b/full/full/0/default.jpg
got: Expected 404 for status; Got: 403
expected: 404
type: url-check
message: Failed to get random identifier from url http://iiif.etu.huiyouwenhua.com/image/a/b/full/full/0/default.jpg.
warning: false

Validator should handle HTTPS scheme

When running the validator locally, I noticed that it does not seem to take into account the --scheme parameter:

iiif-validate.py -s example.org --scheme=https -p iiif -i 67352ccc-d1b0-11e1-89ae-279075081939.jp2 --version=2.0 --level=1 -v

The verbose output shows that image requests are being sent to "http://example.org" instead of "https://example.org".
Moreover, test n°14 fails erroneously because the validator expects an HTTP url in the info.json id field.

[14] test info_json FAIL
  url: ['http://example.org/iiif/67352ccc-d1b0-11e1-89ae-279075081939.jp2/info.json']
  got: False
  expected: True
  type: @id is correct URI
  message: Found: https://example.org/iiif/67352ccc-d1b0-11e1-89ae-279075081939.jp2 Expected: http://example.org/iiif/67352ccc-d1b0-11e1-89ae-279075081939.jp2
  Is Warning?: False

This is a different issue as #43.

Unfairly failing the "Size specified by ,h" test?

V2 validation example:

https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Flbiiif.riksarkivet.se&prefix=%2Fv2%2F&identifier=arkis%2130002046_00022&version=2.0&level=1&id_basic=on&id_squares=on&info_json=on&id_error_escapedslash=on&id_error_random=on&id_error_unescaped=on&id_escaped=on&region_error_random=on&region_pixels=on&size_ch=on&size_error_random=on&size_percent=on&size_region=on&size_wc=on&rot_error_random=on&quality_error_random=on&format_jpg=on&format_error_random=on&baseurl_redirect=on&cors=on&jsonld=on

Image returned: https://lbiiif.riksarkivet.se/v2/arkis!30002046_00022/full/full/0/default.jpg

Fail for
Size specified by ,h
Elapsed time (ms): 1418

url: https://lbiiif.riksarkivet.se/v2/arkis!30002046_00022/full/,696/0/default.jpg
got: Expected (696, 696) for size; Got: (864, 696)
expected: No error
type: General error
message: Failed to check size due to: Expected (696, 696) for size; Got: (864, 696)
warning: false

Size of 864 x 696 px is what we want to get as a response image size. Otherwise with a square value - like given in expected above - the image would get distorted (wrong aspect ratio).

Same sort of fail for V3:

https://iiif.io/api/image/validator/results/?server=https%3A%2F%2Flbiiif.riksarkivet.se&prefix=%2Fv3%2F&identifier=arkis%2130002046_00011&version=3.0&level=1&id_basic=on&id_squares=on&info_json=on&id_error_escapedslash=on&id_error_random=on&id_error_unescaped=on&id_escaped=on&region_error_random=on&region_pixels=on&size_nofull=on&region_square=on&size_ch=on&size_error_random=on&size_noup=on&size_region=on&size_wc=on&size_wh=on&rot_error_random=on&quality_error_random=on&format_jpg=on&format_error_random=on&baseurl_redirect=on&cors=on&jsonld=on

Image returned: https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/full/max/0/default.jpg

Fail for
Size specified by ,h
Elapsed time (ms): 853

url: https://lbiiif.riksarkivet.se/v3/arkis!30002046_00011/full/,508/0/default.jpg
got: Expected (508, 508) for size; Got: (634, 508)
expected: No error
type: General error
message: Failed to check size due to: Expected (508, 508) for size; Got: (634, 508)
warning: false

Size of 634 x 508 px is what we want to get as a response image size. Otherwise with a square value - like given in expected above - the image would get distorted (wrong aspect ratio).

We need to assume that the test is unfairly failing.

Specification: Image API 2.0
https://iiif.io/api/image/2.0/#size

Form of size parameter: ,h | Description: The extracted region should be scaled so that its height is exactly equal to h, and the width will be a calculated value that maintains the aspect ratio of the extracted region.

Specification: Image API 3.0
https://iiif.io/api/image/3.0/#42-size

Form of size parameter: ,h | Description:
The extracted region should be scaled so that the height of the returned image is exactly equal to h. The value of h must not be greater than the height of the extracted region.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.