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
be673def
"src/git@gitlab.inf.unibz.it:Nicola.Pedot/semint-kprime.git" did not exist on "b24ea7ae4474bff9869e10d295e481d2cf7c66dd"
Commit
be673def
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Added presentation preview to the image pages
parent
9bc194a3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
image_template.html
+23
-0
23 additions, 0 deletions
image_template.html
quack.css
+9
-1
9 additions, 1 deletion
quack.css
quack.sh
+23
-6
23 additions, 6 deletions
quack.sh
with
55 additions
and
7 deletions
image_template.html
+
23
−
0
View file @
be673def
...
...
@@ -119,5 +119,28 @@ ${ALTERNATIVES}
${ALTO_ELEMENTS_HTML}
</div>
<h2>
Presentation preview
</h2>
<p>
Downscaled to 150DPI source equivalent, leveled, unsharpened and stored as JPEG.
</p>
<div
id=
"presentation-display"
class=
"openseadragon"
>
</div>
<script
type=
"text/javascript"
>
presentationDragon
=
OpenSeadragon
({
id
:
"
presentation-display
"
,
maxZoomLevel
:
2
,
showNavigator
:
false
,
wrapHorizontal
:
false
,
tileSources
:
{
type
:
'
legacy-image-pyramid
'
,
levels
:[
{
url
:
'
${PRESENTATION}
'
,
width
:
$
{
PRESENTATION_WIDTH
},
height
:
$
{
PRESENTATION_HEIGHT
}
},
]
}});
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
quack.css
+
9
−
1
View file @
be673def
...
...
@@ -140,4 +140,12 @@ ul.alternatives li + li:before {
.whiteoverlay
{
background-size
:
100%
100%
;
pointer-events
:
none
;
}
\ No newline at end of file
}
#presentation-display
{
position
:
relative
;
margin-right
:
340px
;
height
:
900px
;
border
:
1px
solid
black
;
overflow
:
hidden
;
}
This diff is collapsed.
Click to expand it.
quack.sh
+
23
−
6
View file @
be673def
...
...
@@ -77,7 +77,7 @@ if [ -e "quack.settings" ]; then
echo
"Sourcing settings from quack.settings"
source
"quack.settings"
fi
PRESENTATION_SCRIPT
=
"
$ROOT
/presentation.sh"
popd
>
/dev/null
FOLDER_TEMPLATE
=
"
$ROOT
/folder_template.html"
...
...
@@ -162,28 +162,33 @@ function makeImageParams() {
THUMB_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.thumb.jpg"
WHITE_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.white
${
IMAGE_DISP_EXT
}
"
BLACK_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black
${
IMAGE_DISP_EXT
}
"
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
}
# Creates a presentation image and a histogram for the given image
# srcFolder dstFolder image crop
# srcFolder dstFolder image crop
presentation_script
function
makeImages
()
{
local
SRC_FOLDER
=
$1
local
DEST_FOLDER
=
$2
local
IMAGE
=
$3
local
CROP_PERCENT
=
$5
local
PRESENTATION_SCRIPT
=
$6
# echo "makeImages $SRC_FOLDER $DEST_FOLDER"
local
SANS_PATH
=
${
IMAGE
##*/
}
local
BASE
=
${
SANS_PATH
%.*
}
# Should mirror the ones in makeImageParams
# Must mirror the ones in makeImageParams
# Do not cheat by calling makeImageParams as makeImages might
# be called in parallel
local
SOURCE_IMAGE
=
"
${
SRC_FOLDER
}
/
${
IMAGE
}
"
local
DEST_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}${
IMAGE_DISP_EXT
}
"
local
HIST_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.histogram
${
IMAGE_DISP_EXT
}
"
local
THUMB_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.thumb.jpg"
local
WHITE_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.white
${
IMAGE_DISP_EXT
}
"
local
BLACK_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.black
${
IMAGE_DISP_EXT
}
"
local
PRESENTATION_IMAGE
=
"
${
DEST_FOLDER
}
/
${
BASE
}
.presentation.jpg"
if
[
!
-f
$SOURCE_IMAGE
]
;
then
echo
"The source image
$S
does not exists"
>
&2
...
...
@@ -212,6 +217,11 @@ function makeImages() {
gm convert
"
$CONV
"
-black-threshold
1,1,1
-white-threshold
0,0,0
-fill
\#
0000FF
-opaque
black
-transparent
white
-colors
2
"
$BLACK_IMAGE
"
fi
if
[
!
-f
$PRESENTATION_IMAGE
]
;
then
echo
" -
${
PRESENTATION_IMAGE
##*/
}
"
$PRESENTATION_SCRIPT
"
$CONV
"
"
$PRESENTATION_IMAGE
"
fi
if
[
!
-f
$HIST_IMAGE
]
;
then
# Remove "-separate -append" to generate a RGB histogram
# http://www.imagemagick.org/Usage/files/#histogram
...
...
@@ -423,12 +433,15 @@ function makePreviewPage() {
exit
fi
IDENTIFY
=
`
identify
"
$DEST_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
local
IDENTIFY
=
`
identify
"
$DEST_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
IMAGE_WIDTH
=
`
echo
$IDENTIFY
|
grep
-o
"[0-9]
\+
x"
|
grep
-o
"[0-9]
\+
"
`
IMAGE_HEIGHT
=
`
echo
$IDENTIFY
|
grep
-o
"x[0-9]
\+
"
|
grep
-o
"[0-9]
\+
"
`
TIDENTIFY
=
`
identify
"
$THUMB_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
local
TIDENTIFY
=
`
identify
"
$THUMB_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
THUMB_WIDTH
=
`
echo
$TIDENTIFY
|
grep
-o
"[0-9]
\+
x"
|
grep
-o
"[0-9]
\+
"
`
THUMB_HEIGHT
=
`
echo
$TIDENTIFY
|
grep
-o
"x[0-9]
\+
"
|
grep
-o
"[0-9]
\+
"
`
local
PIDENTIFY
=
`
identify
"
$PRESENTATION_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
PRESENTATION_WIDTH
=
`
echo
$PIDENTIFY
|
grep
-o
"[0-9]
\+
x"
|
grep
-o
"[0-9]
\+
"
`
PRESENTATION_HEIGHT
=
`
echo
$PIDENTIFY
|
grep
-o
"x[0-9]
\+
"
|
grep
-o
"[0-9]
\+
"
`
if
[
"true"
==
"
$SKIP_EXISTING_PREVIEWS
"
-a
-e
"
$P
"
]
;
then
return
...
...
@@ -475,6 +488,10 @@ function makePreviewPage() {
IHTML
=
`
template
"
$IHTML
"
"THUMB"
"
$THUMB_LINK
"
`
IHTML
=
`
template
"
$IHTML
"
"THUMB_WIDTH"
"
$THUMB_WIDTH
"
`
IHTML
=
`
template
"
$IHTML
"
"THUMB_HEIGHT"
"
$THUMB_HEIGHT
"
`
PRESENTATION_LINK
=
${
PRESENTATION_IMAGE
##*/
}
IHTML
=
`
template
"
$IHTML
"
"PRESENTATION"
"
$PRESENTATION_LINK
"
`
IHTML
=
`
template
"
$IHTML
"
"PRESENTATION_WIDTH"
"
$PRESENTATION_WIDTH
"
`
IHTML
=
`
template
"
$IHTML
"
"PRESENTATION_HEIGHT"
"
$PRESENTATION_HEIGHT
"
`
WHITE_LINK
=
${
WHITE_IMAGE
##*/
}
IHTML
=
`
template
"
$IHTML
"
"WHITE"
"
$WHITE_LINK
"
`
BLACK_LINK
=
${
BLACK_IMAGE
##*/
}
...
...
@@ -539,7 +556,7 @@ function makeIndex() {
# Generate graphics
# http://stackoverflow.com/questions/11003418/calling-functions-with-xargs-within-a-bash-script
export
-f
makeImages
echo
"
$IMAGES
"
| xargs
-n
1
-I
'{}'
-P
$THREADS
bash
-c
'makeImages "$@"'
_
"
$SRC_FOLDER
"
"
$DEST_FOLDER
"
"{}"
"
$THUMB_IMAGE_SIZE
"
"
$CROP_PERCENT
"
\;
echo
"
$IMAGES
"
| xargs
-n
1
-I
'{}'
-P
$THREADS
bash
-c
'makeImages "$@"'
_
"
$SRC_FOLDER
"
"
$DEST_FOLDER
"
"{}"
"
$THUMB_IMAGE_SIZE
"
"
$CROP_PERCENT
"
"
$PRESENTATION_SCRIPT
"
\;
# Generate pages
local
THUMBS_HTML
=
""
...
...
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