blob: a2acbcb306a3885ba8fd8fd29ed47928c9ef9983 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/bash -e
#set -x
#CONFIG
SOURCEDIR=/etc/vdr/plugins/skinnopacity/logos
OUTPUTDIR=/etc/vdr/plugins/skinnopacity/logos_darkred
FOREGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/fg4.png
BACKGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/bg2.png
#MAIN
IFS=$'\n'
FILES=$(find $SOURCEDIR -name *.png | sort)
sedstring="s!$SOURCEDIR!$OUTPUTDIR!g"
[ ! -d $SOURCEDIR ] && (echo "ERR: $SOURCEDIR1 not found"; exit 1);
[ ! -f $FOREGROUND ] && (echo "ERR: $FOREGROUND not found"; exit 1);
[ ! -f $BACKGROUND ] && (echo "ERR: $BACKGROUND not found"; exit 1);
echo "Convert new logos to format $(basename $OUTPUTDIR)"
for file in $FILES; do
targetdir=`dirname $file | sed -e $sedstring`
targetfile="$targetdir/$(basename $file)"
if [ ! -f $targetfile ] ; then
echo $targetfile
[ ! -d $targetdir ] && mkdir -p $targetdir
convert +dither -background 'transparent' -resize '220x164' -extent '268x200' -gravity 'center' "$file" png:- 2> /dev/null | \
composite - $BACKGROUND png:- 2> /dev/null | \
composite -compose screen -blend 50x100 $FOREGROUND - "$targetfile" 2> /dev/null
fi
done
exit 0
|