Skip to content

Commit

Permalink
Merge pull request #166 from IIIF/addPointSelector
Browse files Browse the repository at this point in the history
Fixing image based point selector
  • Loading branch information
glenrobson committed Jun 21, 2023
2 parents 6c09ff5 + fdee23c commit c328377
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
name: Python ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v2
Expand Down
89 changes: 89 additions & 0 deletions fixtures/3/point_selector.json
@@ -0,0 +1,89 @@
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Using a point selector for annotating a location on a map."
]
},
"summary": {
"en": [
"A map containing an point with an annotation of the location."
]
},
"items": [
{
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json",
"type": "Canvas",
"label": {
"en": [
"Chesapeake and Ohio Canal Pamphlet"
]
},
"height": 5212,
"width": 7072,
"items": [
{
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/contentPage.json",
"type": "AnnotationPage",
"items": [
{
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/content.json",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674/full/max/0/default.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 5212,
"width": 7072,
"service": [
{
"id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674",
"type": "ImageService3",
"profile": "level1"
}
]
},
"target": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json"
}
]
}
],
"annotations": [
{
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/page/p2/1",
"type": "AnnotationPage",
"items": [
{
"id": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/annotation/p0002-tag",
"type": "Annotation",
"label": {
"en": [
"Annotation containing the name of the place annotated using the PointSelector."
]
},
"motivation": "tagging",
"body": {
"type": "TextualBody",
"value": "Town Creek Aqueduct",
"language": "en",
"format": "text/plain"
},
"target": {
"type": "SpecificResource",
"source": "http://localhost:4000/recipe/0135-annotating-point-in-canvas/canvas.json",
"selector": {
"type": "PointSelector",
"x": 3385,
"y": 1464
}
}
}
]
}
]
}
]
}
12 changes: 9 additions & 3 deletions schema/iiif_3_0.json
Expand Up @@ -1011,10 +1011,16 @@
{
"type": "object",
"properties": {
"type": { "type": "string" },
"t": { "$ref": "#/types/duration" }
"type": {
"type": "string",
"pattern": "^PointSelector$",
"default": "PointSelector"
},
"t": { "$ref": "#/types/duration" },
"x": { "$ref": "#/types/dimension" },
"y": { "$ref": "#/types/dimension" }
},
"required": ["type","t"]
"required": ["type"]
},
{
"type": "object",
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -28,6 +28,7 @@ def run(self):
name='iiif-presentation-validator',
version='0.0.3',
scripts=['iiif-presentation-validator.py'],
packages=['schema', 'tests'],
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_validator.py
Expand Up @@ -148,7 +148,8 @@ def test07_check_manifest3(self):
'fixtures/3/anno_source.json',
'fixtures/3/range_range.json',
'fixtures/3/accompanyingCanvas.json',
'fixtures/3/placeholderCanvas.json'
'fixtures/3/placeholderCanvas.json',
'fixtures/3/point_selector.json'
]:
with open(good, 'r') as fh:
print ('Testing: {}'.format(good))
Expand Down

0 comments on commit c328377

Please sign in to comment.