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
a8465ea4
Commit
a8465ea4
authored
11 years ago
by
Toke Eskildsen
Browse files
Options
Downloads
Patches
Plain Diff
Optimization: Slightly faster image size lookup
parent
c47a583f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
analyze.sh
+8
-0
8 additions, 0 deletions
analyze.sh
quack_helper_imagepage.sh
+18
-12
18 additions, 12 deletions
quack_helper_imagepage.sh
with
26 additions
and
12 deletions
analyze.sh
+
8
−
0
View file @
a8465ea4
...
...
@@ -12,6 +12,13 @@ if [ "." == ".$ASSUME_GREY" ]; then
ASSUME_GREY
=
true
fi
# Prints width and height of the given image, separated by space
# Input: Image
function
isize
()
{
identify
-format
"%w %h"
"
$1
"
}
export
-f
isize
# TODO: Accept destination for identify-file as input
# TODO: If FORCE_HISTOGRAM is true, cached identify-files should be deleted
# to ensure CROP_PERCENT is used
...
...
@@ -59,6 +66,7 @@ function im_identify() {
}
export
-f
im_identify
# TODO: Accept destination for grey-stats-file as input
# Input: image
...
...
This diff is collapsed.
Click to expand it.
quack_helper_imagepage.sh
+
18
−
12
View file @
a8465ea4
...
...
@@ -288,21 +288,27 @@ function makePreviewPage() {
exit
fi
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]
\+
"
`
set
--
junk
`
isize
"
$DEST_IMAGE
"
`
shift
IMAGE_WIDTH
=
$1
IMAGE_HEIGHT
=
$2
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]
\+
"
`
local
HIDENTIFY
=
`
identify
"
$HIST_IMAGE
"
|
grep
-o
" [0-9]
\+
x[0-9]
\\
+ "
`
HISTOGRAM_WIDTH
=
`
echo
$HIDENTIFY
|
grep
-o
"[0-9]
\+
x"
|
grep
-o
"[0-9]
\+
"
`
HISTOGRAM_HEIGHT
=
`
echo
$HIDENTIFY
|
grep
-o
"x[0-9]
\+
"
|
grep
-o
"[0-9]
\+
"
`
set
--
junk
`
isize
"
$THUMB_IMAGE
"
`
shift
THUMB_WIDTH
=
$1
THUMB_HEIGHT
=
$2
set
--
junk
`
isize
"
$HIST_IMAGE
"
`
shift
HISTOGRAM_WIDTH
=
$1
HISTOGRAM_HEIGHT
=
$2
if
[
".true"
==
".
$PRESENTATION
"
]
;
then
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]
\+
"
`
set
--
junk
`
isize
"
$PRESENTATION_IMAGE
"
`
shift
PRESENTATION_WIDTH
=
$1
PRESENTATION_HEIGHT
=
$2
fi
local
CREATED_PAGES
=
`
addGetCounter
$PAGE_COUNTER
`
...
...
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