Unverified Commit 977f0974 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

generate valid links to image resources

parent c865e829
Pipeline #21785 passed with stages
in 5 minutes and 58 seconds
......@@ -81,7 +81,16 @@ class Manifest {
Extractors
.digitalObjectId(digitalObject)
.flatMap(id =>
Some(s"$id/iiif/full/max/0/default.jpg")
Extractors
.mimeType(digitalObject)
.flatMap {
case "image/png" => Some("png")
case "image/jpeg" => Some("jpg")
case _ => None
}
.flatMap { extension =>
Some(s"$id.$extension/iiif/full/full/0/default.jpg")
}
)
.getOrElse("")
)
......@@ -308,7 +317,7 @@ class Manifest {
private def replaceDomainNamesWithPlaceholders(jsonObj: String): String = {
jsonObj
.replaceAll(
""""https://memobase.ch/digital/([^/"]+/iiif/full/max/0/default.jpg)""",
""""https://memobase.ch/digital/([^/"]+/iiif/full/full/0/default.jpg)""",
""""{{.IIIFImage}}/$1"""
)
.replaceAll(
......
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/manifest/v2","label":"Büroraum der Firma «Corn Products Co. Ltd»","metadata":[{"label":"placeOfCapture","value":"Zürich, Kornhausbrücke 7"},{"label":"spatial","value":"Zürich"}],"description":"Büroraum mit Arbeitsplätzen, Stehpult, div. Bürotechnische Apparate","navDate":"1933-05-05T00:00:00Z","attribution":"BAZ\n\nnach Absprache","rendering":{"@id":"{{.IIIFRendering}}/BAZ-B_MEI-MEI_67484","label":"website","format":"text/html"},"sequences":[{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/sequence/default","@type":"sc:Sequence","label":"default","canvases":[{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/canvas/default","@type":"sc:Canvas","label":"digitalObject","images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFImage}}/BAZ-B_MEI-MEI_67484-1/iiif/full/max/0/default.jpg","@type":"dctypes:Image","metadata":[{"label":"componentColor","value":["A9A9A9","2F2F4F","000000","527F76","A8A8A8","545454","E6E6FA","C0D9D9"]}],"format":"image/jpeg","width":640,"height":484},"on":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/canvas/default"}],"width":640,"height":484}],"viewingHint":"individuals"}],"viewingHint":"individuals"}
\ No newline at end of file
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/manifest/v2","label":"Büroraum der Firma «Corn Products Co. Ltd»","metadata":[{"label":"placeOfCapture","value":"Zürich, Kornhausbrücke 7"},{"label":"spatial","value":"Zürich"}],"description":"Büroraum mit Arbeitsplätzen, Stehpult, div. Bürotechnische Apparate","navDate":"1933-05-05T00:00:00Z","attribution":"BAZ\n\nnach Absprache","rendering":{"@id":"{{.IIIFRendering}}/BAZ-B_MEI-MEI_67484","label":"website","format":"text/html"},"sequences":[{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/sequence/default","@type":"sc:Sequence","label":"default","canvases":[{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/canvas/default","@type":"sc:Canvas","label":"digitalObject","images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFImage}}/BAZ-B_MEI-MEI_67484-1.jpg/iiif/full/full/0/default.jpg","@type":"dctypes:Image","metadata":[{"label":"componentColor","value":["A9A9A9","2F2F4F","000000","527F76","A8A8A8","545454","E6E6FA","C0D9D9"]}],"format":"image/jpeg","width":640,"height":484},"on":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/canvas/default"}],"width":640,"height":484}],"viewingHint":"individuals"}],"viewingHint":"individuals"}
\ No newline at end of file
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/manifest/v2","label":"Fünfkämpfer Alex Tschui mit René Ziegler","metadata":[{"label":"scopeAndContent","value":"Quelle: RiBiDi"},{"label":"Author","value":"Siegfried Kuhn"}],"navDate":"1968-09-28T00:00:00Z","attribution":"StAAG/RBA\n\nNutzung auf Anfrage. Kein Herunterladen. Über die Nutzungsgebühren werden Sie durch den Rechteinhaber informiert.","rendering":{"@id":"{{.IIIFRendering}}/aag-001-RBA1-4-42733_1","label":"website","format":"text/html"},"sequences":[{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/sequence/default","@type":"sc:Sequence","label":"default","canvases":[{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/canvas/default","@type":"sc:Canvas","label":"digitalObject","images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFImage}}/aag-001-RBA1-4-42733_1-1/iiif/full/max/0/default.jpg","@type":"dctypes:Image","metadata":[{"label":"componentColor","value":["A8A8A8","2F2F4F","000000","C0C0C0","527F76","545454","E6E6FA","A9A9A9"]}],"format":"image/png","width":1600,"height":1072},"on":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/canvas/default"}],"width":1600,"height":1072}],"viewingHint":"individuals"}],"viewingHint":"individuals"}
\ No newline at end of file
{"@context":"http://iiif.io/api/presentation/2/context.json","@type":"sc:Manifest","@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/manifest/v2","label":"Fünfkämpfer Alex Tschui mit René Ziegler","metadata":[{"label":"scopeAndContent","value":"Quelle: RiBiDi"},{"label":"Author","value":"Siegfried Kuhn"}],"navDate":"1968-09-28T00:00:00Z","attribution":"StAAG/RBA\n\nNutzung auf Anfrage. Kein Herunterladen. Über die Nutzungsgebühren werden Sie durch den Rechteinhaber informiert.","rendering":{"@id":"{{.IIIFRendering}}/aag-001-RBA1-4-42733_1","label":"website","format":"text/html"},"sequences":[{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/sequence/default","@type":"sc:Sequence","label":"default","canvases":[{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/canvas/default","@type":"sc:Canvas","label":"digitalObject","images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFImage}}/aag-001-RBA1-4-42733_1-1.png/iiif/full/full/0/default.jpg","@type":"dctypes:Image","metadata":[{"label":"componentColor","value":["A8A8A8","2F2F4F","000000","C0C0C0","527F76","545454","E6E6FA","A9A9A9"]}],"format":"image/png","width":1600,"height":1072},"on":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/canvas/default"}],"width":1600,"height":1072}],"viewingHint":"individuals"}],"viewingHint":"individuals"}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment