Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fakeImages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
vaclab
fakeImages
Commits
c8c9ef6d
Commit
c8c9ef6d
authored
8 years ago
by
Rolf Niepraschk
Browse files
Options
Downloads
Patches
Plain Diff
"testImage" --> "createImages"
parent
2329f490
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
SRG-3/body.png
+0
-0
0 additions, 0 deletions
SRG-3/body.png
SRG-3/char-1.png
+0
-0
0 additions, 0 deletions
SRG-3/char-1.png
SRG-3/createImages
+147
-0
147 additions, 0 deletions
SRG-3/createImages
SRG-3/testImage
+95
-102
95 additions, 102 deletions
SRG-3/testImage
adixen/testImage
+1
-1
1 addition, 1 deletion
adixen/testImage
with
243 additions
and
103 deletions
SRG-3/body.png
+
0
−
0
View replaced file @
2329f490
View file @
c8c9ef6d
394 KiB
|
W:
|
H:
340 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
SRG-3/char-1.png
+
0
−
0
View replaced file @
2329f490
View file @
c8c9ef6d
2.8 KiB
|
W:
|
H:
2.36 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
SRG-3/createImages
0 → 100755
+
147
−
0
View file @
c8c9ef6d
MAIN="SRG-3" # device name
IMAGE_DIR=./images
rm -rf "$IMAGE_DIR"
mkdir -p "$IMAGE_DIR"
MAX_FILES=10
# https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command
urlEncode() {
s="${1//' '/'%20'}"
s="${s//'"'/'%22'}"
s="${s//'#'/'%23'}"
s="${s//'$'/'%24'}"
s="${s//'&'/'%26'}"
s="${s//'+'/'%2B'}"
s="${s//','/'%2C'}"
s="${s//'/'/'%2F'}"
s="${s//':'/'%3A'}"
s="${s//';'/'%3B'}"
s="${s//'='/'%3D'}"
s="${s//'?'/'%3F'}"
s="${s//'@'/'%40'}"
s="${s//'['/'%5B'}"
s="${s//']'/'%5D'}"
printf %s "$s"
}
# or: perl -pe 's/(\W)/sprintf("%%%02X", ord($1))/ge'
# ' code highlight!
# https://stackoverflow.com/questions/6250698/how-to-decode-url-encoded-string-in-shell
urlDecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
emptyCanvas='xc:transparent'
charFile[0]='char-0.png'
charFile[1]='char-1.png'
charFile[2]='char-2.png'
charFile[3]='char-3.png'
charFile[4]='char-4.png'
charFile[5]='char-5.png'
charFile[6]='char-6.png'
charFile[7]='char-7.png'
charFile[8]='char-8.png'
charFile[9]='char-9.png'
charFile[10]='char-dot.png'
charFile[11]='char-minus.png'
charFile[12]='char-s.png'
charFile[13]='char-slash.png'
charFile[14]='char-E.png'
charFile[99]=$emptyCanvas
NUM2CHAR[0]='0'
NUM2CHAR[1]='1'
NUM2CHAR[2]='2'
NUM2CHAR[3]='3'
NUM2CHAR[4]='4'
NUM2CHAR[5]='5'
NUM2CHAR[6]='6'
NUM2CHAR[7]='7'
NUM2CHAR[8]='8'
NUM2CHAR[9]='9'
NUM2CHAR[10]='.'
NUM2CHAR[11]='-'
NUM2CHAR[12]='s'
NUM2CHAR[13]='/'
NUM2CHAR[14]='E'
NUM2CHAR[99]='_'
charPos[16]='+81+92'
charPos[15]='+113+92'
charPos[14]='+145+92'
charPos[13]='+177+92'
charPos[12]='+209+92'
charPos[11]='+241+92'
charPos[10]='+273+92'
charPos[9]='+305+92'
charPos[8]='+337+92'
charPos[7]='+369+92'
charPos[6]='+401+92'
charPos[5]='+433+92'
charPos[4]='+465+92'
charPos[3]='+497+92'
charPos[2]='+529+92'
charPos[1]='+561+92'
for ((FNb=1; FNb<=MAX_FILES; FNb++)); do
dp=$((RANDOM % 7 + 10)) # the place of the dot (10..16)
for i in {10..16}; do # the place of digit number (10..16)
if [ $i == $dp ]; then
CHAR[$i]=10 # dot
else
CHAR[$i]=$((RANDOM % 10)) # random char number (0..9)
fi
done
CHAR[7]=$((RANDOM % 10)) # random char number (0..9)
CHAR[6]=$((RANDOM % 10)) # random char number (0..9)
value=""
value+="${NUM2CHAR[${CHAR[16]}]}"
value+="${NUM2CHAR[${CHAR[15]}]}"
value+="${NUM2CHAR[${CHAR[14]}]}"
value+="${NUM2CHAR[${CHAR[13]}]}"
value+="${NUM2CHAR[${CHAR[12]}]}"
value+="${NUM2CHAR[${CHAR[11]}]}"
value+="${NUM2CHAR[${CHAR[10]}]}E-"
value+="${NUM2CHAR[${CHAR[7]}]}"
value+="${NUM2CHAR[${CHAR[6]}]} 1/s"
value_enc=$(urlEncode "$value")
fname="$IMAGE_DIR/$MAIN@$value_enc@.png"
echo -e "$FNb:\t$fname"
convert body.png \
${charFile[ ${CHAR[16]} ]} -geometry ${charPos[16]} -composite \
${charFile[ ${CHAR[15]} ]} -geometry ${charPos[15]} -composite \
${charFile[ ${CHAR[14]} ]} -geometry ${charPos[14]} -composite \
${charFile[ ${CHAR[13]} ]} -geometry ${charPos[13]} -composite \
${charFile[ ${CHAR[12]} ]} -geometry ${charPos[12]} -composite \
${charFile[ ${CHAR[11]} ]} -geometry ${charPos[11]} -composite \
${charFile[ ${CHAR[10]} ]} -geometry ${charPos[10]} -composite \
${charFile[ 14 ]} -geometry ${charPos[9]} -composite \
${charFile[ 11 ]} -geometry ${charPos[8]} -composite \
${charFile[ ${CHAR[7]} ]} -geometry ${charPos[7]} -composite \
${charFile[ ${CHAR[6]} ]} -geometry ${charPos[6]} -composite \
${charFile[ 1 ]} -geometry ${charPos[4]} -composite \
${charFile[ 13 ]} -geometry ${charPos[3]} -composite \
${charFile[ 12 ]} -geometry ${charPos[2]} -composite \
$fname
exiv2 -M"set Exif.Image.ImageDescription value=$value" $fname
done # MAX_FILES
exit
-----------------------------------------------------------------------
Auslesen der Exif-Daten:
exiv2 -g exiv2 -g Exif.Image.ImageDescription -P v \
./images/SRG-3@88.5341E-58%201%2Fs@.png
--> value=88.5341E-58 1/s
This diff is collapsed.
Click to expand it.
SRG-3/testImage
+
95
−
102
View file @
c8c9ef6d
#!/bin/bash
MAIN
=
"
adixen
"
# device name
MAIN
=
"
SRG-3
"
# device name
IMAGE_DIR
=
./images
emptyCanvas
=
'xc:transparent'
rm
-rf
"
$IMAGE_DIR
"
mkdir
-p
"
$IMAGE_DIR
"
# https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command
urlEncode
()
{
s
=
"
${
1
//
' '
/
'%20'
}
"
s
=
"
${
s
//
'"'
/
'%22'
}
"
s
=
"
${
s
//
'#'
/
'%23'
}
"
s
=
"
${
s
//
'$'
/
'%24'
}
"
s
=
"
${
s
//
'&'
/
'%26'
}
"
s
=
"
${
s
//
'+'
/
'%2B'
}
"
s
=
"
${
s
//
','
/
'%2C'
}
"
s
=
"
${
s
//
'/'
/
'%2F'
}
"
s
=
"
${
s
//
':'
/
'%3A'
}
"
s
=
"
${
s
//
';'
/
'%3B'
}
"
s
=
"
${
s
//
'='
/
'%3D'
}
"
s
=
"
${
s
//
'?'
/
'%3F'
}
"
s
=
"
${
s
//
'@'
/
'%40'
}
"
s
=
"
${
s
//
'['
/
'%5B'
}
"
s
=
"
${
s
//
']'
/
'%5D'
}
"
printf
%s
"
$s
"
}
# or: perl -pe 's/(\W)/sprintf("%%%02X", ord($1))/ge'
# ' code highlight!
# https://stackoverflow.com/questions/6250698/how-to-decode-url-encoded-string-in-shell
urlDecode
()
{
:
"
${
*//+/
}
"
;
echo
-e
"
${
_
//%/\\x
}
"
;
}
fname
=
yy.png
emptyCanvas
=
'xc:transparent'
dotFile[0]
=
$emptyCanvas
dotFile[1]
=
'char-dot.png'
fname
=
'yy.png'
charFile[0]
=
'char-0.png'
charFile[1]
=
'char-1.png'
...
...
@@ -20,33 +45,13 @@ charFile[6]='char-6.png'
charFile[7]
=
'char-7.png'
charFile[8]
=
'char-8.png'
charFile[9]
=
'char-9.png'
charFile[10]
=
'char-A.png'
charFile[11]
=
'char-C.png'
charFile[12]
=
'char-E.png'
charFile[13]
=
'char-F.png'
charFile[14]
=
'char-H.png'
charFile[15]
=
'char-r.png'
charFile[16]
=
'char-minus.png'
charFile[10]
=
'char-dot.png'
charFile[11]
=
'char-minus.png'
charFile[12]
=
'char-s.png'
charFile[13]
=
'char-slash.png'
charFile[14]
=
'char-E.png'
charFile[99]
=
$emptyCanvas
eCharFile[0]
=
'char-e0.png'
eCharFile[1]
=
'char-e1.png'
eCharFile[2]
=
'char-e2.png'
eCharFile[3]
=
'char-e3.png'
eCharFile[4]
=
'char-e4.png'
eCharFile[5]
=
'char-e5.png'
eCharFile[6]
=
'char-e6.png'
eCharFile[7]
=
'char-e7.png'
eCharFile[8]
=
'char-e8.png'
eCharFile[9]
=
'char-e9.png'
eCharFile[99]
=
$emptyCanvas
ePrefixFile[0]
=
'char-eMinus.png'
ePrefixFile[1]
=
'char-ePlus.png'
NUM2PREFIXCHAR[0]
=
'-'
NUM2PREFIXCHAR[1]
=
'+'
NUM2CHAR[0]
=
'0'
NUM2CHAR[1]
=
'1'
NUM2CHAR[2]
=
'2'
...
...
@@ -57,90 +62,78 @@ NUM2CHAR[6]='6'
NUM2CHAR[7]
=
'7'
NUM2CHAR[8]
=
'8'
NUM2CHAR[9]
=
'9'
NUM2CHAR[10]
=
'A'
NUM2CHAR[11]
=
'C'
NUM2CHAR[12]
=
'E'
NUM2CHAR[13]
=
'F'
NUM2CHAR[14]
=
'H'
NUM2CHAR[15]
=
'r'
NUM2CHAR[16]
=
'-'
NUM2CHAR[99]
=
' '
NUM2DOTCHAR[0]
=
''
NUM2DOTCHAR[1]
=
'.'
NUM2CHAR[10]
=
'.'
NUM2CHAR[11]
=
'-'
NUM2CHAR[12]
=
's'
NUM2CHAR[13]
=
'/'
NUM2CHAR[14]
=
'E'
NUM2CHAR[99]
=
'_'
# character at pos
CHAR[6]
=
8
# "0" to "16" ("16"=minus)
CHAR[5]
=
4
# "0" to "15"
CHAR[4]
=
5
# "0" to "15"
CHAR[3]
=
3
# "0" to "15"
CHAR[2]
=
1
# "0" to "15"
CHAR[1]
=
2
# "0" to "15"
# dot character at pos ("0" or "1")
DOTCHAR[6]
=
0
DOTCHAR[5]
=
1
DOTCHAR[4]
=
0
DOTCHAR[3]
=
0
DOTCHAR[2]
=
0
DOTCHAR[1]
=
0
CHAR[16]
=
9
# "0" to "10" (10=dot)
CHAR[15]
=
10
# "0" to "10" (10=dot)
CHAR[14]
=
4
# "0" to "10" (10=dot)
CHAR[13]
=
5
# "0" to "10" (10=dot)
CHAR[12]
=
8
# "0" to "10" (10=dot)
CHAR[11]
=
1
# "0" to "10" (10=dot)
CHAR[10]
=
2
# "0" to "10" (10=dot)
# exponent character at pos
ECHAR[2]
=
1
# "1" or "99" (leer)
ECHAR[1]
=
5
# "0" to "9"
CHAR[7]
=
0
# "0" to "9"
CHAR[6]
=
7
# "0" to "9"
charPos[16]
=
'+81+92'
charPos[15]
=
'+113+92'
charPos[14]
=
'+145+92'
charPos[13]
=
'+177+92'
charPos[12]
=
'+209+92'
charPos[11]
=
'+241+92'
charPos[10]
=
'+273+92'
charPos[9]
=
'+305+92'
charPos[8]
=
'+337+92'
charPos[7]
=
'+369+92'
charPos[6]
=
'+401+92'
charPos[5]
=
'+433+92'
charPos[4]
=
'+465+92'
charPos[3]
=
'+497+92'
charPos[2]
=
'+529+92'
charPos[1]
=
'+561+92'
value
=
""
value+
=
"
${
NUM2CHAR
[
${
CHAR
[16]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[15]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[14]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[13]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[12]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[11]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[10]
}
]
}
E-"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[7]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[6]
}
]
}
1/s"
EPREFIX
=
1
# "0"=minus, "1"=plus
value_enc
=
$(
urlEncode
"
$value
"
)
charPos[6]
=
'+80+192'
charPos[5]
=
'+148+192'
charPos[4]
=
'+215+192'
charPos[3]
=
'+282+192'
charPos[2]
=
'+348+192'
charPos[1]
=
'+417+192'
fname
=
"
$IMAGE_DIR
/
$MAIN
@
$value_enc
@.png"
dotPos[6]
=
'+133+191'
dotPos[5]
=
'+199+191'
dotPos[4]
=
'+265+191'
dotPos[3]
=
'+331+191'
dotPos[2]
=
'+398+191'
dotPos[1]
=
'+465+191'
echo
-e
"
$fname
"
eCharPos[3]
=
'+483+191'
eCharPos[2]
=
'+512+191'
eCharPos[1]
=
'+532+191'
fname
=
yy.png
convert body.png
\
${
charFile
[
${
CHAR
[16]
}
]
}
-geometry
${
charPos
[16]
}
-composite
\
${
charFile
[
${
CHAR
[15]
}
]
}
-geometry
${
charPos
[15]
}
-composite
\
${
charFile
[
${
CHAR
[14]
}
]
}
-geometry
${
charPos
[14]
}
-composite
\
${
charFile
[
${
CHAR
[13]
}
]
}
-geometry
${
charPos
[13]
}
-composite
\
${
charFile
[
${
CHAR
[12]
}
]
}
-geometry
${
charPos
[12]
}
-composite
\
${
charFile
[
${
CHAR
[11]
}
]
}
-geometry
${
charPos
[11]
}
-composite
\
${
charFile
[
${
CHAR
[10]
}
]
}
-geometry
${
charPos
[10]
}
-composite
\
${
charFile
[ 14 ]
}
-geometry
${
charPos
[9]
}
-composite
\
${
charFile
[ 11 ]
}
-geometry
${
charPos
[8]
}
-composite
\
${
charFile
[
${
CHAR
[7]
}
]
}
-geometry
${
charPos
[7]
}
-composite
\
${
charFile
[
${
CHAR
[6]
}
]
}
-geometry
${
charPos
[6]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[6]
}
]
}
-geometry
${
dotPos
[6]
}
-composite
\
${
charFile
[
${
CHAR
[5]
}
]
}
-geometry
${
charPos
[5]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[5]
}
]
}
-geometry
${
dotPos
[5]
}
-composite
\
${
charFile
[
${
CHAR
[4]
}
]
}
-geometry
${
charPos
[4]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[4]
}
]
}
-geometry
${
dotPos
[4]
}
-composite
\
${
charFile
[
${
CHAR
[3]
}
]
}
-geometry
${
charPos
[3]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[3]
}
]
}
-geometry
${
dotPos
[3]
}
-composite
\
${
charFile
[
${
CHAR
[2]
}
]
}
-geometry
${
charPos
[2]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[2]
}
]
}
-geometry
${
dotPos
[2]
}
-composite
\
${
charFile
[
${
CHAR
[1]
}
]
}
-geometry
${
charPos
[1]
}
-composite
\
${
dotFile
[
${
DOTCHAR
[1]
}
]
}
-geometry
${
dotPos
[1]
}
-composite
\
${
ePrefixFile
[
${
EPREFIX
}
]
}
-geometry
${
eCharPos
[3]
}
-composite
\
${
eCharFile
[
${
ECHAR
[2]
}
]
}
-geometry
${
eCharPos
[2]
}
-composite
\
${
eCharFile
[
${
ECHAR
[1]
}
]
}
-geometry
${
eCharPos
[1]
}
-composite
\
${
charFile
[ 1 ]
}
-geometry
${
charPos
[4]
}
-composite
\
${
charFile
[ 13 ]
}
-geometry
${
charPos
[3]
}
-composite
\
${
charFile
[ 12 ]
}
-geometry
${
charPos
[2]
}
-composite
\
$fname
value
=
""
value+
=
"
${
NUM2CHAR
[
${
CHAR
[6]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[6]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[5]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[5]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[4]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[4]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[3]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[3]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[2]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[2]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
CHAR
[1]
}
]
}${
NUM2DOTCHAR
[
${
DOTCHAR
[1]
}
]
}
"
value+
=
"
${
NUM2PREFIXCHAR
[
${
EPREFIX
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
ECHAR
[2]
}
]
}
"
value+
=
"
${
NUM2CHAR
[
${
ECHAR
[1]
}
]
}
"
fname
=
"
$IMAGE_DIR
/
$MAIN
@
$value
@.png"
echo
-e
"
$fname
"
exit
This diff is collapsed.
Click to expand it.
adixen/testImage
+
1
−
1
View file @
c8c9ef6d
...
...
@@ -64,7 +64,7 @@ NUM2CHAR[13]='F'
NUM2CHAR[14]
=
'H'
NUM2CHAR[15]
=
'r'
NUM2CHAR[16]
=
'-'
NUM2CHAR[99]
=
'
'
NUM2CHAR[99]
=
'
_
'
NUM2DOTCHAR[0]
=
''
NUM2DOTCHAR[1]
=
'.'
...
...
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