Adding Watermark and Temp to the Image using macgick

The probably most tricky part of preparing the Image for the Website.
For documentation purposes.

The workaround to name the file TEMP.bakjpg is due to the deletion of remaining *.jpg files in the directory in the last step of the script.

rm *.jpg

Therefore i am renaming the image capt*.jpg to TEMP.bakjpg to prevent the current image from being deleted. The problem was, if the script is canceled du to an error or outage, there are more then one shots in the temp folder from the last captures.

DATE=$(date +"%Y%m%d_%H%M")
DATEPIC=$(date +"%d.%m.%Y um %H:%M Uhr")
TEMP=$(cat /home/pi/Logs/tempoutsideusb.log)
TEMPPI=$(tail /home/pi/Logs/temppi.log | cut -c 32-40)

for file in TEMP.bakjpg ; do
convert "$file" -quality 55% -resize 100% \
-crop 3888x2187+0+0 \
-fill "rgba(255,255,255,0.70)" -opaque "rgb(255,255,255)" -draw 'rectangle 0,0,3888,40' \
-fill "rgba(255,255,255,0.70)" -opaque "rgb(255,255,255)" -draw 'rectangle 3370,2150,3888,2187' \
-font /usr/share/fonts/truetype/dejavu/DejaVuSansCondensed.ttf \
-pointsize 26 -fill black -annotate +10+32 "$DATEPIC" \
-pointsize 26 -fill black -annotate +1800+32 'Lufttemperatur:' \
-pointsize 26 -fill black -annotate +2010+32 $TEMP \
-pointsize 26 -fill black -annotate +2075+32 '°C' \
-pointsize 26 -fill black -annotate +3430+32 'Grosskirchheim | 46.9696 N 12.8980 E' \
-pointsize 26 -fill black -annotate +3375+2178 'kleinlercher.me | clemens@kleinlercher.me' \
-pointsize 26 -fill black -annotate +0+0 '' \
"current.jpg"
done

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert