Skip to content

Commit

Permalink
Merge pull request #50 from IIIF-Commons/feature/image-2-fixes
Browse files Browse the repository at this point in the history
Various fixes for image-2 compatibility
  • Loading branch information
stephenwf authored Jan 4, 2025
2 parents e90e2a4 + 2728017 commit 6f2fc6c
Show file tree
Hide file tree
Showing 11 changed files with 312 additions and 739 deletions.
14 changes: 6 additions & 8 deletions __tests__/image-3-parser/parameters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ describe('IIIF Image API Parameters', () => {
});
test('Request an image fixed at 600 by 400', () => {
const parsed = parseImageServiceRequest(
'https://framemark.vam.ac.uk/collections/2006AN7529/full/600,400/0/default.jpg'
'https://framemark.vam.ac.uk/collections/2006AN7529/full/600,/0/default.jpg'
);
expect(parsed).toMatchInlineSnapshot(`
{
"format": "jpg",
"identifier": "collections/2006AN7529",
"originalPath": "collections/2006AN7529/full/600,400/0/default.jpg",
"originalPath": "collections/2006AN7529/full/600,/0/default.jpg",
"prefix": "",
"quality": "default",
"region": {
Expand All @@ -196,7 +196,6 @@ describe('IIIF Image API Parameters', () => {
"server": "framemark.vam.ac.uk",
"size": {
"confined": false,
"height": 400,
"max": false,
"upscaled": false,
"width": 600,
Expand All @@ -205,18 +204,18 @@ describe('IIIF Image API Parameters', () => {
}
`);
expect(imageServiceRequestToString(parsed)).toEqual(
'https://framemark.vam.ac.uk/collections/2006AN7529/full/600,400/0/default.jpg'
'https://framemark.vam.ac.uk/collections/2006AN7529/full/600,/0/default.jpg'
);
});
test('Request a 100 by 100 (retaining aspect ratio) thumbnail', () => {
const parsed = parseImageServiceRequest(
'https://framemark.vam.ac.uk/collections/2016JL5779/full/!100,100/0/default.jpg'
'https://framemark.vam.ac.uk/collections/2016JL5779/full/!100,/0/default.jpg'
);
expect(parsed).toMatchInlineSnapshot(`
{
"format": "jpg",
"identifier": "collections/2016JL5779",
"originalPath": "collections/2016JL5779/full/!100,100/0/default.jpg",
"originalPath": "collections/2016JL5779/full/!100,/0/default.jpg",
"prefix": "",
"quality": "default",
"region": {
Expand All @@ -229,7 +228,6 @@ describe('IIIF Image API Parameters', () => {
"server": "framemark.vam.ac.uk",
"size": {
"confined": true,
"height": 100,
"max": false,
"upscaled": false,
"width": 100,
Expand All @@ -238,7 +236,7 @@ describe('IIIF Image API Parameters', () => {
}
`);
expect(imageServiceRequestToString(parsed)).toEqual(
'https://framemark.vam.ac.uk/collections/2016JL5779/full/!100,100/0/default.jpg'
'https://framemark.vam.ac.uk/collections/2016JL5779/full/!100,/0/default.jpg'
);
});
test('Request a greyscale version', () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
"devDependencies": {
"@types/node": "^18",
"@hyperion-framework/validator": "^1.1.0",
"@happy-dom/global-registrator": "^6.0.4",
"@happy-dom/global-registrator": "^16.3.0",
"prettier": "^3.2.5",
"tslib": "^2.6.2",
"typescript": "^5.4.4",
"vitest": "^1.4.0",
"vitest": "^2.1.8",
"publint": "^0.2.7",
"tsup": "^8.0.2"
},
Expand Down
Loading

0 comments on commit 6f2fc6c

Please sign in to comment.