Skip to content

Commit 3a0111d

Browse files
committed
fix IIIF resource id for Wikipedia images
due to some bug(?) in the zoomviewer.toolforge.org service
1 parent 32ca336 commit 3a0111d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/img.xqm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ declare %private function img:wikipedia-images($model as map(*), $lang as xs:str
229229
let $iiifInfo := er:wikimedia-iiif(functx:substring-after-last($linkTarget, ':'))
230230
return
231231
try {
232-
if($iiifInfo('height') > 340) then $iiifInfo('@id') || '/full/,340/0/native.jpg'
233-
else $iiifInfo('@id') || '/full/full/0/native.jpg'
232+
(: need to fix the IIIF image id due to some bug(?) in the zoomviewer.toolforge.org service :)
233+
if($iiifInfo('height') gt 340) then replace($iiifInfo('@id'), 'cache/', 'fcgi-bin/iipsrv.fcgi/?iiif=cache%2F') || '/full/,340/0/native.jpg'
234+
else replace($iiifInfo('@id'), 'cache/', 'fcgi-bin/iipsrv.fcgi/?iiif=cache%2F') || '/full/full/0/native.jpg'
234235
}
235236
catch * { $thumbURI }
236237
default return

0 commit comments

Comments
 (0)