Commit 75b794bb authored by mrodzis's avatar mrodzis 🌎
Browse files

Remove deprecate computation of image height (cf. print@35432e43)

parent 1449475f
......@@ -606,7 +606,6 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
(element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{
$node/@*,
attribute href {tbleapi:get-url($uri, $node/@xml:id, "png")},
attribute height-in-mm {fontaneSimple:get-height-in-mm($uri, $node/@xml:id)},
fontaneSimple:transform($node/node(), $uri)
}, util:log-system-out($node))
else
......@@ -958,42 +957,4 @@ as element(tei:term)* {
}
else
()
};
(:~
: @param $current-uri The URI of the current notebook, e.g. '16b00' :)
declare function fontaneSimple:get-height-in-mm($current-uri as xs:string,
$xml-id as xs:string) as xs:string {
let $url := tbleapi:get-url($current-uri, $xml-id, "png")
let $height-percent := xs:double(local:get-height-percent($url))
let $width-percent := xs:double(local:get-width-percent($url))
let $ratio := $height-percent div $width-percent
(: print area has a width of 113mm :)
return xs:string(113 * $ratio)
};
(:https://textgridlab.org/1.0/digilib/rest/IIIF/textgrid:164hd/pct:7.468949311849614,12.023834858480528,40.56730446458543,38.518833794424346/,1000/0/default.png:)
(:let $url := "https://textgridlab.org/1.0/digilib/rest/IIIF/"
|| $image || '/pct:' || $x || ',' || $y || ',' || $w || ',' || $h
|| "/,1000/" || $rotation || "/default." || $format:)
declare function local:get-height-percent($url as xs:string) {
let $parameters := local:get-parameters($url)
return
$parameters[4]
};
declare function local:get-width-percent($url as xs:string) {
let $parameters := local:get-parameters($url)
return
$parameters[3]
};
declare function local:get-parameters($url as xs:string) as xs:string* {
substring-after($url, "pct:")
=> substring-before("/,1000")
=> tokenize(",")
};
\ No newline at end of file
Markdown is supported
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