Hallo, Am Die, 19 Okt 2010, Roman Fietze schrieb: [..]
#!/bin/bash set -x
function rect { echo "-stroke black -strokewidth 3 -draw 'rectangle 1,2 5,6'" } [..] Aber das geht ja schief, Der Parameter zu -draw wird in seine Einzelteile zerlegt. Also habe ich mir mit folgender Kruecke beholfen:
Nimm Array-Variablen.
function rect { # after some mathematics echo "-stroke $5 -strokewidth $6 -draw 'rectangle $x0,$y0 $x1,$y1'" }
==== make_rect() { # after some mathematics RECT=( "${RECT[@]}" -stroke "$5" -strokewidth "$6" \ -draw "rectangle $x0,$y0 $x1,$y1" ) } ====
... exiftool Output parsen und in Variablen mit dem Namen der Tags ablegen ...
convert ... \ -fill transparent \ $( ...
for i in "${AFPointsInFocus[@]}" do rect ${AFAreaXPositions[$i]
$afinfocuscolor 3 done ... # noch AFPointsSelected ) \ ...
====
RECT=()
for i in "${AFPointsInFocus[@]}"; do
make_rect ${AFAreaXPositions[$i]