Skip to content

Commit 5058046

Browse files
authored
Merge pull request #103 from internetarchive/issue_101
Addressing Issue 101.
2 parents bb10482 + 0e01aee commit 5058046

17 files changed

+64
-65
lines changed

iiify/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ def collection3page(identifier, page):
171171
@cache.cached(timeout=cache_timeouts["long"], forced_update=cache_bust)
172172
def collectionJSON(identifier):
173173
validate_ia_identifier(identifier, page_suffix=False)
174-
return redirect(f'/iiif/3/{identifier}/collection.json', code=302)
174+
return collection3JSON(identifier)
175175

176176

177177
@app.route('/iiif/<identifier>/<page>/collection.json')
178178
@cache.cached(timeout=cache_timeouts["long"], forced_update=cache_bust)
179179
def collectionPage(identifier, page):
180180
validate_ia_identifier(identifier, page_suffix=False)
181-
return redirect(f'/iiif/3/{identifier}/{page}/collection.json', code=302)
181+
return collection3page(identifier, page)
182182

183183

184184
@app.route('/iiif/3/<identifier>/manifest.json')
@@ -219,7 +219,7 @@ def vtt_stream(identifier):
219219
@cache.cached(timeout=cache_timeouts["long"], forced_update=cache_bust)
220220
def manifest(identifier):
221221
validate_ia_identifier(identifier, page_suffix=False)
222-
return redirect(f'/iiif/3/{identifier}/manifest.json', code=302)
222+
return manifest3(identifier)
223223

224224
@app.route('/iiif/2/<identifier>/manifest.json')
225225
def manifest2(identifier):

iiify/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def create_manifest(identifier, domain=None, page=None):
243243

244244
manifest = {
245245
'@context': PRZ_CTX,
246-
'@id': '%s%s/manifest.json' % (domain, identifier),
246+
'@id': '%s2/%s/manifest.json' % (domain,identifier),
247247
'@type': 'sc:Manifest',
248248
'description': metadata.get('description', ''),
249249
'logo': 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcReMN4l9cgu_qb1OwflFeyfHcjp8aUfVNSJ9ynk2IfuHwW1I4mDSw',

iiify/templates/docs/collections.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ <h4>Example</h4>
1414
<pre>leedsuniversitylibrary</pre>
1515

1616
<p>To then get the IIIF collection manifest, plug in the ID to the following template:</p>
17-
<div class="request">https://iiif.archive.org/iiif/3/<b>:id</b>/collection.json</div>
17+
<div class="request">https://iiif.archive.org/iiif/<b>:id</b>/collection.json</div>
1818

1919
<p>For the Leeds example above, the final IIIF collection manifest URL would be:</p>
20-
<div class="request">https://iiif.archive.org/iiif/3/leedsuniversitylibrary/collection.json</div>
20+
<div class="request">https://iiif.archive.org/iiif/leedsuniversitylibrary/collection.json</div>
2121

2222
<h3>Note about nested collections</h3>
2323
<p>Please note that Internet Archive collections can be arbitrarily nested within other collections. In these cases, the IIIF collection manifest will return a link to one or more IIIF collection manifest(s) in addition to the items nested individually within that Internet Archive collection.</p>
@@ -34,10 +34,10 @@ <h2><a name="resources-listing">Pagination for large collections</a></h2>
3434

3535
<table>
3636
<thead><td>Collection manifest URL</td><td>Items retrieved</td></thead>
37-
<tr><td>https://iiif.archive.org/iiif/3/leedsuniversitylibrary/collection.json</td><td>0-999</td></tr>
38-
<tr><td>https://iiif.archive.org/iiif/3/leedsuniversitylibrary/2/collection.json</td><td>1000-1999</td></tr>
39-
<tr><td>https://iiif.archive.org/iiif/3/leedsuniversitylibrary/3/collection.json</td><td>2000-2999</td></tr>
40-
<tr><td>https://iiif.archive.org/iiif/3/leedsuniversitylibrary/4/collection.json</td><td>3000-3775</td></tr>
37+
<tr><td>https://iiif.archive.org/iiif/leedsuniversitylibrary/collection.json</td><td>0-999</td></tr>
38+
<tr><td>https://iiif.archive.org/iiif/leedsuniversitylibrary/2/collection.json</td><td>1000-1999</td></tr>
39+
<tr><td>https://iiif.archive.org/iiif/leedsuniversitylibrary/3/collection.json</td><td>2000-2999</td></tr>
40+
<tr><td>https://iiif.archive.org/iiif/leedsuniversitylibrary/4/collection.json</td><td>3000-3775</td></tr>
4141
</table>
4242
</section>
4343
</article>

iiify/templates/docs/items.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ <h4>Example</h4>
3939
<p>So, from our example just above, the Internet Archive identifier for that item is: <pre>img-8664_202009</pre></p>
4040

4141
<p>To then get the IIIF manifest, plug in the ID to the following template:</p>
42-
<div class="request">https://iiif.archive.org/iiif/3/<b>:id</b>/manifest.json</div>
42+
<div class="request">https://iiif.archive.org/iiif/<b>:id</b>/manifest.json</div>
4343

4444
<p>For the example above, the final IIIF manifest URL would be:</p>
45-
<div class="request">https://iiif.archive.org/iiif/3/img-8664_202009/manifest.json</div>
45+
<div class="request">https://iiif.archive.org/iiif/img-8664_202009/manifest.json</div>
4646

4747
<h3>Note about IIIF Presentation API versions</h3>
4848
<p>

iiify/templates/docs/overview.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h3><a name="overview-conventions"></a>Convention: IDs</h3>
1515
emphasis:
1616
</p>
1717

18-
<div class="request">https://iiif.archive.org/iiif/3/<strong>:id</strong>/manifest.json</div>
18+
<div class="request">https://iiif.archive.org/iiif/<strong>:id</strong>/manifest.json</div>
1919
</section>
2020

2121
<h2>Getting started</h2>
@@ -45,7 +45,7 @@ <h2><a name="presentation-api"></a>Presentation API</h2>
4545
<p>The Presentation API can also faciliate the portability and playback of time-based media like audio and video files. In the A/V context, IIIF manifests often present multiple playback options based on the media formats and quality types available.</p>
4646

4747
<p>A manifest for an Internet Archive item looks like this:</p>
48-
<div class="request">https://iiif.archive.org/iiif/3/<b>:id</b>/manifest.json</div>
48+
<div class="request">https://iiif.archive.org/iiif/<b>:id</b>/manifest.json</div>
4949

5050
<p>See the sections below for all the possible ways to retrieve manifests for <a href="#items">items</a> and <a href="#collections">collections</a>.</p>
5151

@@ -66,10 +66,10 @@ <h2><a name="image-api"></a>Image API</h2>
6666
<p>The Image API creates images using the following template: </p>
6767
<div class="request">{scheme}://{server}/{prefix}/{identifier}/{region}/{size}/{rotation}/{quality}.{format}</div>
6868
<p>In the context of the Internet Archive items, that will look like this for a full image:</p>
69-
<div class="request">https://iiif.archive.org/image/iiif/3/<b>:id+filename</b>/full/max/0/default.jpg</div>
69+
<div class="request">https://iiif.archive.org/image/iiif/<b>:id+filename</b>/full/max/0/default.jpg</div>
7070

7171
<p>Making use of the various parameters, a request for a bitonal center-cropped square image 375 pixels on each side, rotated 45 degrees will look like this:</p>
72-
<div class="request">https://iiif.archive.org/image/iiif/3/<b>:id+filename</b>/square/375,/45/bitonal.jpg</div>
72+
<div class="request">https://iiif.archive.org/image/iiif/<b>:id+filename</b>/square/375,/45/bitonal.jpg</div>
7373

7474
<p>See the <a href="https://iiif.io/api/image/3.0/#4-image-requests">Image API section on "Image Requests"</a> for more details on how images can be manipulated and specific sizes or sections retrieved.</p>
7575

@@ -90,11 +90,11 @@ <h4>Example</h4>
9090
<p>In order to get the :id+filename the way you need it for the IIIF Image API info.json, you can combine the ID and filename with a URL encoded slash, i.e. %2f.</p>
9191

9292
<p>So for this image, the info.json would be:</p>
93-
<div class="request">https://iiif.archive.org/image/iiif/3/img-8664_202009%2fIMG_8664.jpg/info.json</div>
93+
<div class="request">https://iiif.archive.org/image/iiif/img-8664_202009%2fIMG_8664.jpg/info.json</div>
9494
<p>And the full URL for the image would be:</p>
95-
<div class="request">https://iiif.archive.org/image/iiif/3/img-8664_202009%2fIMG_8664.jpg/full/max/0/default.jpg</div>
95+
<div class="request">https://iiif.archive.org/image/iiif/img-8664_202009%2fIMG_8664.jpg/full/max/0/default.jpg</div>
9696
<p>A cropped portion at the full resolution can be requested like this:</p>
97-
<div class="request">https://iiif.archive.org/image/iiif/3/img-8664_202009%2fIMG_8664.jpg/<b>1100,904,704,664</b>/max/0/default.jpg</div>
97+
<div class="request">https://iiif.archive.org/image/iiif/img-8664_202009%2fIMG_8664.jpg/<b>1100,904,704,664</b>/max/0/default.jpg</div>
9898
<p>Where "1100,904,704,664" in that URL stands for 1100 pixels from the left edge, 904 pixels from the bottom edge, 704 pixels is the width of the desired section, and 664 pixels is the height.</p>
9999

100100

iiify/templates/helper.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
<p>The manifest URL is: <a href="{{ uri }}/manifest.json">{{ uri }}/manifest.json</a></p>
1919

20-
<p>The Image API URL for the full image is: <a href="https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/full/max/0/default.jpg">https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/full/max/0/default.jpg</a></p>
20+
<p>The Image API URL for the full image is: <a href="https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/full/max/0/default.jpg">https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/full/max/0/default.jpg</a></p>
2121

22-
<p>The Image API info.json for the image is: <a href="https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/info.json">https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/info.json</a></p>
22+
<p>The Image API info.json for the image is: <a href="https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/info.json">https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/info.json</a></p>
2323

2424
</body>
2525
</html>

iiify/templates/helpers/audio.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ <h1>IIIF Presentation API Audio Helper</h1>
2525

2626
<p>The IA identifier is: {{ identifier }}</p>
2727

28-
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json</a></p>
28+
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json</a></p>
2929

3030
<h2>IIIF player options for this mediatype:</h2>
3131
<ul>
32-
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Universal Viewer</a></li>
33-
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Mirador comparison viewer/player</a></li>
34-
<li><a href="https://iiif-react-media-player.netlify.app//?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Ramp</a></li>
35-
<li><a href="https://iiif.aviaryplatform.com/player?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Aviary</a></li>
36-
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Clover</a></li>
32+
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Universal Viewer</a></li>
33+
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Mirador comparison viewer/player</a></li>
34+
<li><a href="https://iiif-react-media-player.netlify.app//?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Ramp</a></li>
35+
<li><a href="https://iiif.aviaryplatform.com/player?manifest=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Aviary</a></li>
36+
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Clover</a></li>
3737

3838
</ul>
3939

iiify/templates/helpers/collection.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ <h1>IIIF Collection Helper</h1>
2424

2525
<p>The IA identifier is: {{ identifier }}</p>
2626

27-
<p>The IIIF collection URL is: <a href="https://iiif.archive.org/iiif/3/{{ identifier }}/collection.json">https://iiif.archive.org/iiif/3/{{ identifier }}/collection.json</a></p>
27+
<p>The IIIF collection URL is: <a href="https://iiif.archive.org/iiif/{{ identifier }}/collection.json">https://iiif.archive.org/iiif/{{ identifier }}/collection.json</a></p>
2828

2929
<h2>IIIF viewer options</h2>
3030
<ul>
31-
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/collection.json">Mirador</a></li>
32-
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/collection.json">Universal Viewer</a></li>
33-
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/collection.json">Clover</a></li>
31+
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/collection.json">Mirador</a></li>
32+
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/{{ identifier }}/collection.json">Universal Viewer</a></li>
33+
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/collection.json">Clover</a></li>
3434

3535
</ul>
3636

iiify/templates/helpers/image.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ <h1>IIIF Image Helper</h1>
2424

2525
<p>The IA identifier is: {{ identifier }}</p>
2626

27-
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json</a></p>
27+
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/{{ identifier }}/manifest.json</a></p>
2828

29-
<p>The Image API URL for the full image is: <a href="https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/full/max/0/default.jpg">https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/full/max/0/default.jpg</a></p>
29+
<p>The Image API URL for the full image is: <a href="https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/full/max/0/default.jpg">https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/full/max/0/default.jpg</a></p>
3030

31-
<p>The Image API info.json for the image is: <a href="https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/info.json">https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}/info.json</a></p>
31+
<p>The Image API info.json for the image is: <a href="https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/info.json">https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}/info.json</a></p>
3232

3333
<h2>IIIF viewer options</h2>
3434
<ul>
35-
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Mirador</a></li>
36-
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Universal Viewer</a></li>
37-
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Clover</a></li>
35+
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Mirador</a></li>
36+
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Universal Viewer</a></li>
37+
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Clover</a></li>
3838

3939
</ul>
4040

4141
<h2>IIIF image tool options</h2>
4242
<ul>
43-
<li><a href="https://iiifimage.link/#https://iiif.archive.org/image/iiif/3/{{ esc_cantaloupe_id }}/full/max/0/default.jpg">IIIF Image Inspector</a></li>
43+
<li><a href="https://iiifimage.link/#https://iiif.archive.org/image/iiif/{{ esc_cantaloupe_id }}/full/max/0/default.jpg">IIIF Image Inspector</a></li>
4444
<li><a href="https://ncsu-libraries.github.io/iiif-crop-tool/?newUrl=https://iiif.archive.org/image/iiif/2/{{ esc_cantaloupe_id }}/full/full/0/default.jpg">NC State Image Cropper</a></li>
45-
<li><a href="https://jbhoward-dublin.github.io/IIIF-imageManipulation/index.html?imageID=https://iiif.archive.org/image/iiif/3/{{ cantaloupe_id }}">IIIF Image Manipulation Tool</a></li>
45+
<li><a href="https://jbhoward-dublin.github.io/IIIF-imageManipulation/index.html?imageID=https://iiif.archive.org/image/iiif/{{ cantaloupe_id }}">IIIF Image Manipulation Tool</a></li>
4646
<li><a href="https://glenrobson.github.io/CanvasFinder/">CanvasFinder (Note: paste in the manifest URL noted above)</a></li>
4747
</ul>
4848

iiify/templates/helpers/movies.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ <h1>IIIF Presentation API Movies Helper</h1>
2424

2525
<p>The IA identifier is: {{ identifier }}</p>
2626

27-
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json</a></p>
27+
<p>The IIIF manifest URL is: <a href="https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">https://iiif.archive.org/iiif/{{ identifier }}/manifest.json</a></p>
2828

2929
<h2>IIIF viewer options for this mediatype:</h2>
3030
<ul>
31-
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Universal Viewer</a></li>
32-
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Mirador comparison viewer</a></li>
33-
<li><a href="https://iiif-react-media-player.netlify.app//?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Ramp</a></li>
34-
<li><a href="https://iiif.aviaryplatform.com/player?manifest=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Aviary</a></li>
35-
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/3/{{ identifier }}/manifest.json">Clover</a></li>
31+
<li><a href="https://uv-v4.netlify.app/#?manifest=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Universal Viewer</a></li>
32+
<li><a href="https://projectmirador.org/embed/?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Mirador comparison viewer</a></li>
33+
<li><a href="https://iiif-react-media-player.netlify.app//?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Ramp</a></li>
34+
<li><a href="https://iiif.aviaryplatform.com/player?manifest=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Aviary</a></li>
35+
<li><a href="https://samvera-labs.github.io/clover-iiif?iiif-content=https://iiif.archive.org/iiif/{{ identifier }}/manifest.json">Clover</a></li>
3636

3737
</ul>
3838

0 commit comments

Comments
 (0)