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
3fd01a7d
Commit
3fd01a7d
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Forces .alto.xml file ending for ALTO files in destination, slight change to accuracy display
parent
48b8f6e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quack.sh
+9
-5
9 additions, 5 deletions
quack.sh
web/image_template.html
+1
-1
1 addition, 1 deletion
web/image_template.html
with
10 additions
and
6 deletions
quack.sh
+
9
−
5
View file @
3fd01a7d
...
@@ -295,9 +295,9 @@ function template () {
...
@@ -295,9 +295,9 @@ function template () {
# srcFolder dstFolder image
# srcFolder dstFolder image
# Output: SOURCE_IMAGE DEST_IMAGE HIST_IMAGE THUMB
# Output: SOURCE_IMAGE DEST_IMAGE HIST_IMAGE THUMB
function
makeImageParams
()
{
function
makeImageParams
()
{
local
SRC_FOLDER
=
$1
local
SRC_FOLDER
=
"
$1
"
local
DEST_FOLDER
=
$2
local
DEST_FOLDER
=
"
$2
"
local
IMAGE
=
$3
local
IMAGE
=
"
$3
"
local
SANS_PATH
=
${
IMAGE
##*/
}
local
SANS_PATH
=
${
IMAGE
##*/
}
local
BASE
=
${
SANS_PATH
%.*
}
local
BASE
=
${
SANS_PATH
%.*
}
...
@@ -313,6 +313,7 @@ function makeImageParams() {
...
@@ -313,6 +313,7 @@ function makeImageParams() {
BLACK_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black.png"
BLACK_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black.png"
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
TILE_FOLDER
=
"
${
DEST_FOLDER
}
/
${
BASE
}
_files"
TILE_FOLDER
=
"
${
DEST_FOLDER
}
/
${
BASE
}
_files"
ALTO_DEST
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.alto.xml"
}
}
# If force is true and image exists, image is deleted and true returned
# If force is true and image exists, image is deleted and true returned
...
@@ -365,6 +366,7 @@ function makeImages() {
...
@@ -365,6 +366,7 @@ function makeImages() {
local
THUMB_OVERLAY_BLACK
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black.thumb.png"
local
THUMB_OVERLAY_BLACK
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black.thumb.png"
local
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
local
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
local
TILE_FOLDER
=
"
${
DEST_FOLDER
}
/
${
BASE
}
_files"
local
TILE_FOLDER
=
"
${
DEST_FOLDER
}
/
${
BASE
}
_files"
local
ALTO_DEST
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.alto.xml"
if
[
!
-f
$SOURCE_IMAGE
]
;
then
if
[
!
-f
$SOURCE_IMAGE
]
;
then
echo
"The source image
$S
does not exists"
>
&2
echo
"The source image
$S
does not exists"
>
&2
...
@@ -546,14 +548,16 @@ function processALTO() {
...
@@ -546,14 +548,16 @@ function processALTO() {
OVERLAYS
=
"
${
OVERLAYS
}
]"
OVERLAYS
=
"
${
OVERLAYS
}
]"
return
return
fi
fi
cp
"
$ALTO
"
"
$DEST
"
cp
"
$ALTO
"
"
$ALTO_DEST
"
# Extract key elements from the ALTO
# Extract key elements from the ALTO
local
ALTO_COMPACT
=
`
cat
"
$ALTO_FILE
"
|
sed
':a;N;$!ba;s/\\n/ /g'
`
local
ALTO_COMPACT
=
`
cat
"
$ALTO_FILE
"
|
sed
':a;N;$!ba;s/\\n/ /g'
`
# local PTAG=`echo "$ALTO_COMPACT" | grep -o "<PrintSpace[^>]\\+>"`
# local PTAG=`echo "$ALTO_COMPACT" | grep -o "<PrintSpace[^>]\\+>"`
local
PTAG
=
`
echo
"
$ALTO_COMPACT
"
|
grep
-o
"<Page[^>]
\\
+>"
`
local
PTAG
=
`
echo
"
$ALTO_COMPACT
"
|
grep
-o
"<Page[^>]
\\
+>"
`
local
PHEIGHT
=
`
echo
$PTAG
|
sed
's/.*HEIGHT=\"\([^"]\+\)".*/\\1/g'
`
local
PHEIGHT
=
`
echo
$PTAG
|
sed
's/.*HEIGHT=\"\([^"]\+\)".*/\\1/g'
`
local
PWIDTH
=
`
echo
$PTAG
|
sed
's/.*WIDTH=\"\([^"]\+\)".*/\\1/g'
`
local
PWIDTH
=
`
echo
$PTAG
|
sed
's/.*WIDTH=\"\([^"]\+\)".*/\\1/g'
`
ACCURACY
=
`
echo
$PTAG
|
sed
's/.*ACCURACY=\"\([^"]\+\)".*/\\1/g'
`
ACCURACY
=
`
echo
$PTAG
|
sed
's/.*PC=\"\([^"]\+\)".*/\\1/g'
`
ACCURACY
=
`
echo
"scale=2;
$ACCURACY
*100"
| bc
`
FULL_RELATIVE_HEIGHT
=
`
echo
"scale=6;
$PHEIGHT
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
FULL_RELATIVE_HEIGHT
=
`
echo
"scale=6;
$PHEIGHT
/
$PWIDTH
"
| bc |
sed
's/^\./0./'
`
# TODO: Ponder how relative positioning works and why this hack is necessary
# TODO: Ponder how relative positioning works and why this hack is necessary
...
...
This diff is collapsed.
Click to expand it.
web/image_template.html
+
1
−
1
View file @
3fd01a7d
...
@@ -30,7 +30,7 @@ Darkest ${GREY_FIRST}: ${GREY_PERCENT_FIRST}%<br/>
...
@@ -30,7 +30,7 @@ Darkest ${GREY_FIRST}: ${GREY_PERCENT_FIRST}%<br/>
Spike ${GREY_SPIKE}: ${GREY_PERCENT_SPIKE}%
<br/>
Spike ${GREY_SPIKE}: ${GREY_PERCENT_SPIKE}%
<br/>
Lightest ${GREY_LAST}: ${GREY_PERCENT_LAST}%
<br/>
Lightest ${GREY_LAST}: ${GREY_PERCENT_LAST}%
<br/>
Unique greyscale values: ${GREY_UNIQUE}
<br/>
Unique greyscale values: ${GREY_UNIQUE}
<br/>
ALTO-
accuracy
: ${ACCURACY}%
ALTO-
PC
: ${ACCURACY}%
<p><input
type=
"checkbox"
id=
"toggle_grid"
onClick=
"toggleGrid();"
>
Grid
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_grid"
onClick=
"toggleGrid();"
>
Grid
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_textblock"
checked=
"checked"
onClick=
"toggleTextBlock();"
>
TextBlocks
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_textblock"
checked=
"checked"
onClick=
"toggleTextBlock();"
>
TextBlocks
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_blown"
onClick=
"toggleBlown();"
>
Black/white
</input></p>
<p><input
type=
"checkbox"
id=
"toggle_blown"
onClick=
"toggleBlown();"
>
Black/white
</input></p>
...
...
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