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

add thumbnail link to manifest

parent 8f3e3945
Pipeline #21857 passed with stages
in 7 minutes and 5 seconds
...@@ -80,9 +80,7 @@ class Manifest { ...@@ -80,9 +80,7 @@ class Manifest {
val imageContent = new IIIFImageContent( val imageContent = new IIIFImageContent(
Extractors Extractors
.digitalObjectId(digitalObject) .digitalObjectId(digitalObject)
.flatMap(id => .flatMap(id => Some(s"$id/iiif/full/full/0/default.jpg"))
Some(s"$id/iiif/full/full/0/default.jpg")
)
.getOrElse("") .getOrElse("")
) )
Extractors Extractors
...@@ -121,6 +119,10 @@ class Manifest { ...@@ -121,6 +119,10 @@ class Manifest {
Extractors Extractors
.imageWidth(digitalObject) .imageWidth(digitalObject)
.foreach(v => canvas.setWidth(v.round.toInt)) .foreach(v => canvas.setWidth(v.round.toInt))
Extractors
.digitalObjectId(digitalObject)
.flatMap(id => Some(s"$id/iiif/full/!150,/0/default.jpg"))
.foreach(v => canvas.addThumbnail(new IIIFImageContent(v)))
canvas canvas
} }
...@@ -143,6 +145,10 @@ class Manifest { ...@@ -143,6 +145,10 @@ class Manifest {
Extractors.manifestId(digitalObject).getOrElse("") Extractors.manifestId(digitalObject).getOrElse("")
) )
val extractionResult = ExtractionResult(manifest) val extractionResult = ExtractionResult(manifest)
Extractors
.digitalObjectId(digitalObject)
.flatMap(id => Some(s"$id/iiif/full/!150,/0/default.jpg"))
.foreach(v => manifest.addThumbnail(new IIIFImageContent(v)))
Extractors Extractors
.title(record) .title(record)
.foreach(v => manifest.addLabel(v)) .foreach(v => manifest.addLabel(v))
...@@ -308,7 +314,7 @@ class Manifest { ...@@ -308,7 +314,7 @@ class Manifest {
private def replaceDomainNamesWithPlaceholders(jsonObj: String): String = { private def replaceDomainNamesWithPlaceholders(jsonObj: String): String = {
jsonObj jsonObj
.replaceAll( .replaceAll(
""""https://memobase.ch/digital/([^/"]+/iiif/full/full/0/default.jpg)""", """"https://memobase.ch/digital/([^/"]+/iiif/[^/"]/[^/"]/0/default.jpg)""",
""""{{.IIIFImage}}/$1""" """"{{.IIIFImage}}/$1"""
) )
.replaceAll( .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/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"} {"@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","thumbnail":{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/iiif/full/!150,/0/default.jpg","format":"image/jpeg"},"images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/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"}],"thumbnail":{"@id":"{{.IIIFManifest}}/BAZ-B_MEI-MEI_67484-1/iiif/full/!150,/0/default.jpg","format":"image/jpeg"},"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/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"} {"@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","thumbnail":{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/iiif/full/!150,/0/default.jpg","format":"image/jpeg"},"images":[{"@type":"oa:Annotation","motivation":"sc:painting","resource":{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/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"}],"thumbnail":{"@id":"{{.IIIFManifest}}/aag-001-RBA1-4-42733_1-1/iiif/full/!150,/0/default.jpg","format":"image/jpeg"},"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