Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/iiif 2.1 #10

Merged
merged 23 commits into from
Aug 21, 2018
Merged

Feature/iiif 2.1 #10

merged 23 commits into from
Aug 21, 2018

Conversation

jechols
Copy link
Member

@jechols jechols commented Aug 21, 2018

Closes #9

Makes logging consistent: if info.json response isn't cached, we log
something, whether it's from reading the JP2 or from reading overrides
This makes it easier to test out capability toggling
Adds custom marshal and unmarshal operations to handle the mixed data
type in the info profile.  This makes the Profile itself typesafe,
though the code has to be far more verbose.
Adds configurable global maximums for all of RAIS, which, if set, will
report the maximums when info.json is requested for an image which
exceeds one or more of the values
Refactors the response helpers so they're sending/receiving the
iiif.Info structure rather than raw byte slices.  We can use this to
test for unsupported size requests, and in the future this would let us
use overridden info.json data to restrict capabilities on a per-image
basis.
This will add a tiny bit of overhead since zero was previously handled
in the C libraries (openjpeg and image magick), but it ensures the final
image dimensions are going to be known ahead of time, which we have to
have in order to restrict output without the decode cost
Go conventions say lowercase first letter, so while I'm here I'm fixing
this.  Take that, past-jechols!
Effectively moves the test "maximums" structure to be useable outside of
testing so our handler has a more encapsulated way of expressing this
and testing against a given image
If an info.json would report a zero value for any dimension, we
explicitly override that with the maximum possible value.  Usually a
zero means the value wasn't set, but this also works even if zero is
explicitly set because it wouldn't make sense to actually serve images
if you wanted a limit of zero.
Fixes test which was pulling the test JP2 that has constraints built
into it when we want to test custom constraints
Unlike other features, we aren't going to try and disable requests for
these even if the capabilities file is set to disallow them, as it's
just not really worth the extra complexity in the code.  There isn't
really any significant performance loss if these features are
"illegally" requested by a client
New features means new test failures!  Oh boy, mom!
@jechols jechols merged commit 85376bc into develop Aug 21, 2018
@jechols jechols deleted the feature/iiif-2.1 branch August 21, 2018 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant