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
3587bb36
Commit
3587bb36
authored
8 years ago
by
Rolf Niepraschk
Browse files
Options
Downloads
Patches
Plain Diff
"testImage" --> "createImages"
parent
73ee9649
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
adixen/createImages
+165
-0
165 additions, 0 deletions
adixen/createImages
adixen/testImage
+6
-14
6 additions, 14 deletions
adixen/testImage
with
171 additions
and
14 deletions
adixen/createImages
0 → 100755
+
165
−
0
View file @
3587bb36
#!/bin/bash
#
# Rolf Niepraschk <Rolf.Niepraschk@ptb.de>, 2016-01-12
#
# Erzeugt aus einem leeren Messgeräte-Bild und neun 7-Segment-Bildern
# neue Messgeräte-Bilder mit zufälliger Anzeige
#
MAIN
=
"adixen"
# device name
IMAGE_DIR
=
./images
MAX_FILES
=
10
rm
-rf
"
$IMAGE_DIR
"
mkdir
-p
"
$IMAGE_DIR
"
emptyCanvas
=
'xc:transparent'
dotFile[0]
=
$emptyCanvas
dotFile[1]
=
'char-dot.png'
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-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[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'
NUM2CHAR[3]
=
'3'
NUM2CHAR[4]
=
'4'
NUM2CHAR[5]
=
'5'
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]
=
'.'
charPos[6]
=
'+80+192'
charPos[5]
=
'+148+192'
charPos[4]
=
'+215+192'
charPos[3]
=
'+282+192'
charPos[2]
=
'+348+192'
charPos[1]
=
'+417+192'
dotPos[6]
=
'+133+191'
dotPos[5]
=
'+199+191'
dotPos[4]
=
'+265+191'
dotPos[3]
=
'+331+191'
dotPos[2]
=
'+398+191'
dotPos[1]
=
'+465+191'
eCharPos[3]
=
'+483+191'
eCharPos[2]
=
'+512+191'
eCharPos[1]
=
'+532+191'
for
((
FNb
=
1
;
FNb<
=
MAX_FILES
;
FNb++
))
;
do
dp
=
$((
RANDOM
%
6
+
1
))
# the place of the dot (1..6)
for
i
in
{
1..6
}
;
do
# the place of digit number (1..6)
if
[
$i
==
6
]
;
then
CHAR[
$i
]=
$((
RANDOM
%
17
))
# random char number (0..16, 16=minus)
else
CHAR[
$i
]=
$((
RANDOM
%
16
))
# random char number (0..15)
fi
if
[
$i
==
$dp
]
;
then
DOTCHAR[
$i
]=
1
# dot
else
DOTCHAR[
$i
]=
0
# empty
fi
EPREFIX
=
$((
RANDOM
%
2
))
# 0..1 (0=minus, 1=plus)
ECHAR[2]
=
$((
RANDOM
%
2
))
# random char number (1 or 99, 99="_")
if
[
${
ECHAR
[2]
}
==
0
]
;
then
ECHAR[2]
=
99
;
fi
ECHAR[1]
=
$((
RANDOM
%
10
))
# random char number (0..9)
done
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
"
$FNb
:
\t
$fname
"
convert body.png
\
${
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
\
$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/adixen@2.C1F20-_8@.png
--
>
value
=
2.C1F20-_8
This diff is collapsed.
Click to expand it.
adixen/testImage
+
6
−
14
View file @
3587bb36
...
...
@@ -85,14 +85,6 @@ DOTCHAR[3]=0
DOTCHAR[2]
=
0
DOTCHAR[1]
=
0
# dot at pos
DOT[6]
=
0
DOT[5]
=
1
DOT[4]
=
0
DOT[3]
=
0
DOT[2]
=
0
DOT[1]
=
0
# exponent character at pos
ECHAR[2]
=
1
# "1" or "99" (leer)
ECHAR[1]
=
5
# "0" to "9"
...
...
@@ -119,17 +111,17 @@ eCharPos[1]='+532+191'
convert body.png
\
${
charFile
[
${
CHAR
[6]
}
]
}
-geometry
${
charPos
[6]
}
-composite
\
${
dotFile
[
${
DOT
[6]
}
]
}
-geometry
${
dotPos
[6]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[6]
}
]
}
-geometry
${
dotPos
[6]
}
-composite
\
${
charFile
[
${
CHAR
[5]
}
]
}
-geometry
${
charPos
[5]
}
-composite
\
${
dotFile
[
${
DOT
[5]
}
]
}
-geometry
${
dotPos
[5]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[5]
}
]
}
-geometry
${
dotPos
[5]
}
-composite
\
${
charFile
[
${
CHAR
[4]
}
]
}
-geometry
${
charPos
[4]
}
-composite
\
${
dotFile
[
${
DOT
[4]
}
]
}
-geometry
${
dotPos
[4]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[4]
}
]
}
-geometry
${
dotPos
[4]
}
-composite
\
${
charFile
[
${
CHAR
[3]
}
]
}
-geometry
${
charPos
[3]
}
-composite
\
${
dotFile
[
${
DOT
[3]
}
]
}
-geometry
${
dotPos
[3]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[3]
}
]
}
-geometry
${
dotPos
[3]
}
-composite
\
${
charFile
[
${
CHAR
[2]
}
]
}
-geometry
${
charPos
[2]
}
-composite
\
${
dotFile
[
${
DOT
[2]
}
]
}
-geometry
${
dotPos
[2]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[2]
}
]
}
-geometry
${
dotPos
[2]
}
-composite
\
${
charFile
[
${
CHAR
[1]
}
]
}
-geometry
${
charPos
[1]
}
-composite
\
${
dotFile
[
${
DOT
[1]
}
]
}
-geometry
${
dotPos
[1]
}
-composite
\
${
dotFile
[
${
DOT
CHAR
[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
\
...
...
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