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
288a817e
Commit
288a817e
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Closes #30 (Display original image size in pixels)
parent
a13c9403
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
quack.sh
+8
-9
8 additions, 9 deletions
quack.sh
web/folder_template.html
+8
-3
8 additions, 3 deletions
web/folder_template.html
web/image_template.html
+1
-1
1 addition, 1 deletion
web/image_template.html
web/imagelink_template.html
+1
-0
1 addition, 0 deletions
web/imagelink_template.html
with
18 additions
and
13 deletions
quack.sh
+
8
−
9
View file @
288a817e
...
...
@@ -682,6 +682,7 @@ function makePreviewPage() {
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]
\+
"
`
IMAGE_MP
=
`
echo
"scale=1;x=
$IMAGE_WIDTH
*
$IMAGE_HEIGHT
/1000000; if(x<1) print 0; x"
| bc
`
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]
\+
"
`
...
...
@@ -724,7 +725,7 @@ function makePreviewPage() {
NAVIGATION
=
"
${
NAVIGATION
}
| next"
fi
# PARENT, DATE, UP, NAVIGATION, BASE, SOURCE, FULL_RELATIVE_HEIGHT, EDEST, IMAGE_WIDTH, IMAGE_HEIGHT, TILE_SOURCES, THUMB, THUMB_WIDTH, THUMB_HEIGHT, PRESENTATION, PRESENTATION_WIDTH, PRESENTATION_HEIGHT, WHITE, BLACK, OVERLAYS, OCR_CONTENT, IDNEXTS, IDPREVS, ALTO_ELEMENTS_HTML, HISTOGRAM, ALTO, ALTERNATIVES
# PARENT, DATE, UP, NAVIGATION, BASE, SOURCE, FULL_RELATIVE_HEIGHT, EDEST, IMAGE_WIDTH, IMAGE_HEIGHT,
IMAGE_MP,
TILE_SOURCES, THUMB, THUMB_WIDTH, THUMB_HEIGHT, PRESENTATION, PRESENTATION_WIDTH, PRESENTATION_HEIGHT, WHITE, BLACK, OVERLAYS, OCR_CONTENT, IDNEXTS, IDPREVS, ALTO_ELEMENTS_HTML, HISTOGRAM, ALTO, ALTERNATIVES
SOURCE
=
"
$SOURCE_IMAGE
"
SOURCE_SHORT
=
${
SOURCE
##*/
}
SOURCE_SIZE
=
`
du
-k
"
$SOURCE
"
|
grep
-o
"^[0-9]
\+
"
`
...
...
@@ -877,25 +878,23 @@ function makeIndex() {
# Generate pages
local
THUMBS_HTML
=
""
local
HISTOGRAMS_HTML
=
""
local
ILIST_HTML
=
""
local
PREV_IMAGE
=
""
if
[
"."
==
".
$IMAGES
"
]
;
then
IMAGES_HTML
=
"<p>No images</p>"
$'
\n
'
THUMBS_HTML
=
"<p>No images</p>"
$'
\n
'
HISTOGRAMS_HTML
=
"<p>No images</p>"
$'
\n
'
else
# http://www.kryogenix.org/code/browser/sorttable/
IMAGES_HTML
=
"<table class=
\"
imagelinks sortable
\"
><tr><th>Image</th> <th>Dark</th> <th>Spike</th> <th>Light</th> <th>Unique</th> <th>Holes</th> <th>OCR</th> <th>KB</th></tr>"
$'
\n
'
HISTOGRAMS_HTML
=
""
$'
\n
'
for
I
in
$IMAGES
;
do
local
NEXT_IMAGE
=
`
echo
"
$IMAGES
"
|
grep
-A
1
"
$I
"
|
tail
-n
1 |
grep
-v
"
$I
"
`
makePreviewPage
"
$UP
"
"
$PARENT
"
"
$SRC_FOLDER
"
"
$DEST_FOLDER
"
"
$I
"
"
$PREV_IMAGE
"
"
$NEXT_IMAGE
"
I
MAGES
_HTML
=
"
${
I
MAGES
_HTML
}
`
cat
\"
$ILINK
\"
`
"
$'
\n
'
# I
MAGES
_HTML=<li><a href=\"$PAGE_LINK\">$BASE</a></li>"$'\n'
I
LIST
_HTML
=
"
${
I
LIST
_HTML
}
`
cat
\"
$ILINK
\"
`
"
$'
\n
'
# I
LIST
_HTML=<li><a href=\"$PAGE_LINK\">$BASE</a></li>"$'\n'
THUMBS_HTML
=
"
${
THUMBS_HTML
}
<div class=
\"
thumb
\"
><a class=
\"
thumblink
\"
href=
\"
$PAGE_LINK
\"
><span class=
\"
thumboverlay
\"
></span><img class=
\"
thumbimg
\"
src=
\"
${
THUMB_LINK
}
\"
alt=
\"
$BASE
\"
title=
\"
$BASE
\"
width=
\"
$THUMB_WIDTH
\"
height=
\"
$THUMB_HEIGHT
\"
/></a></div>"
$'
\n
'
HISTOGRAMS_HTML
=
"
${
HISTOGRAMS_HTML
}
<div class=
\"
histograminfolder
\"
><a href=
\"
$PAGE_LINK
\"
><img src=
\"
${
HISTOGRAM_LINK
}
\"
alt=
\"
Histogram for
$BASE
\"
title=
\"
Histogram for
$BASE
\"
width=
\"
$HISTOGRAM_WIDTH
\"
height=
\"
$HISTOGRAM_HEIGHT
\"
/></a></div>"
$'
\n
'
# THUMBS_HTML="${THUMBS_HTML}<a class=\"thumblink\" href=\"$PAGE_LINK\"><img class=\"thumbimg\" src=\"${THUMB_LINK}\" alt=\"$BASE\" title=\"$BASE\" width=\"$THUMB_WIDTH\" height=\"$THUMB_HEIGHT\"/></a>"$'\n'
PREV_IMAGE
=
$I
done
IMAGES_HTML
=
"
${
IMAGES_HTML
}
</table>"
$'
\n
'
fi
local
SUBS
=
`
ls
"
$SRC_FOLDER
"
`
...
...
@@ -938,7 +937,7 @@ function makeIndex() {
fi
popd
>
/dev/null
# UP, PARENT, SRC_FOLDER, DEST_FOLDER, I
MAGES
_HTML, THUMBS_HTML, HISTOGRAMS_HTML, SUBFOLDERS_HTML, EDITION_HTML, SNIPPET
# UP, PARENT, SRC_FOLDER, DEST_FOLDER, I
LIST
_HTML, THUMBS_HTML, HISTOGRAMS_HTML, SUBFOLDERS_HTML, EDITION_HTML, SNIPPET
ctemplate
$FOLDER_TEMPLATE
>
$PP
# Generate pages for sub folders
...
...
This diff is collapsed.
Click to expand it.
web/folder_template.html
+
8
−
3
View file @
288a817e
...
...
@@ -19,11 +19,16 @@
<div
class=
"images"
>
<h2>
Pages
</h2>
<p><input
type=
"checkbox"
id=
"toggle_blown_thumbs"
onClick=
"toggleBlownThumbs();"
>
Show absolute black and white
</input><br/><input
type=
"checkbox"
id=
"toggle_histograms"
onClick=
"toggleHistograms();"
>
Histogram view
</input></p>
<div
class=
"thumbs"
>
${THUMBS_HTML}
</div>
<div
class=
"histograms"
>
${HISTOGRAMS_HTML}
</div>
<div
class=
"imagelinks"
>
${IMAGES_HTML}
</div>
<!-- http://www.kryogenix.org/code/browser/sorttable/ -->
<div
class=
"imagelinks"
><table
class=
"imagelinks sortable"
><tr><th>
Image
</th>
<th>
Dark
</th>
<th>
Spike
</th>
<th>
Light
</th>
<th>
Unique
</th>
<th>
Holes
</th>
<th>
OCR
</th>
<th>
KB
</th>
<th>
MP
</th></tr>
${ILIST_HTML}
</table></div>
</div>
<div
class=
"subfolders"
>
...
...
This diff is collapsed.
Click to expand it.
web/image_template.html
+
1
−
1
View file @
288a817e
...
...
@@ -103,7 +103,7 @@ ALTO-PC: ${ACCURACY}%
<!-- TODO: Create decent bread crumbs -->
<p>
Parent folder:
<a
href=
"index.html"
>
${PARENT}
</a></p>
<p>
Source: ${SOURCE} (${SOURCE_SIZE} KB)
</p>
<p>
Source: ${SOURCE} (${SOURCE_SIZE} KB
, ${IMAGE_MP} MP
)
</p>
<p>
Direct:
<a
href=
"${IMAGE}"
>
${IMAGE}
</a></p>
<div
class=
"alto"
>
...
...
This diff is collapsed.
Click to expand it.
web/imagelink_template.html
+
1
−
0
View file @
288a817e
...
...
@@ -7,4 +7,5 @@
<td>
${GREY_HOLES}
</td>
<td>
${ACCURACY}%
</td>
<td>
${SOURCE_SIZE}
</td>
<td>
${IMAGE_MP}
</td>
</tr>
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