Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Quack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
commul
Zeit.shift
Quack
Commits
2d292781
Commit
2d292781
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Added optional scaling of ALTO coordinates
parent
d027b092
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quack.sh
+10
-5
10 additions, 5 deletions
quack.sh
with
10 additions
and
5 deletions
quack.sh
+
10
−
5
View file @
2d292781
...
...
@@ -53,6 +53,11 @@ IMAGE_GLOB="*.tiff *.tif *.jp2 *.jpeg2000 *.j2k *.jpg *.jpeg"
# OurScanProject_batch_2013-09-18_page_007.alto.xml
ALTO_EXT
=
".alto.xml"
# Sometimes the image corresponding to the ALTO has been scaled after ALTO
# generation. This factor will be multiplied to all ALTO elements. If the
# image has been scaled to half width & half height, set this to 0.5.
ALTO_SCALE_FACTOR
=
"1.0"
# The image format for the QA image. Possible values are png and jpg.
# png is recommended if QA should check image quality in detail.
export
IMAGE_DISP_EXT
=
"png"
...
...
@@ -380,12 +385,12 @@ function processElements() {
local
BHPOS
=
`
echo
$BTAG
|
sed
's/.*HPOS=\"\([^"]\+\)".*/\\1/g'
`
local
BVPOS
=
`
echo
$BTAG
|
sed
's/.*VPOS=\"\([^"]\+\)".*/\\1/g'
`
local
SWIDTH
=
`
echo
"scale=6;
$BWIDTH
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
local
SWIDTH
=
`
echo
"scale=6;
$BWIDTH
/
$PWIDTH
*
$ALTO_SCALE_FACTOR
"
| bc |
sed
's/^\./0./'
`
# TODO: Seems like there is some mismatch going on here with some deliveries
local
SHEIGHT
=
`
echo
"scale=6;
$BHEIGHT
/
$PHEIGHT
"
| bc |
sed
's/^\./0./'
`
local
SHEIGHT
=
`
echo
"scale=6;
$BHEIGHT
/
$PHEIGHT
*
$ALTO_SCALE_FACTOR
"
| bc |
sed
's/^\./0./'
`
# SHEIGHT=`echo "scale=6;$BHEIGHT/$PWIDTH" | bc | sed 's/^\./0./'`
local
SHPOS
=
`
echo
"scale=6;
$BHPOS
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
local
SVPOS
=
`
echo
"scale=6;
$BVPOS
/
$PHEIGHT
"
| bc |
sed
's/^\./0./'
`
local
SHPOS
=
`
echo
"scale=6;
$BHPOS
/
$PWIDTH
*
$ALTO_SCALE_FACTOR
"
| bc |
sed
's/^\./0./'
`
local
SVPOS
=
`
echo
"scale=6;
$BVPOS
/
$PHEIGHT
*
$ALTO_SCALE_FACTOR
"
| bc |
sed
's/^\./0./'
`
# Special handling of TextBlock
if
[
"TextBlock"
==
"
$TAG
"
]
;
then
...
...
@@ -451,7 +456,7 @@ function processALTO() {
ELEMENTS_HTML
=
"
${
ELEMENTS_HTML
}
</table>"
$'
\n
'
# Special overlays to show absolute black and absolute white pixels
# The
2.0
is a hack as OpenSeaDragon scales with respect to width
# The
FULL_REL
is a hack as OpenSeaDragon scales with respect to width
OVERLAYS
=
"overlays: ["
$'
\n
'
OVERLAYS
=
"
${
OVERLAYS
}
{id: 'white',"
$'
\n
'
OVERLAYS
=
"
${
OVERLAYS
}
x: 0.0, y: 0.0, width: 1.0, height:
${
FULL_RELATIVE_HEIGHT
}
,"
$'
\n
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment