Benutzer-Werkzeuge

Webseiten-Werkzeuge


collagenbildererstellencolor
x
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin,image/jpeg
Actions=Collage_1x2;Collage_1x3;Collage_2x1;Collage_2x2;Collage_2x3;Collage_2x4;Collage_3x1;Collage_3x2;Collage_3x3;Collage_3x4;Collage_3x5;Collage_3x6;Collage_4x3;Collage_4x4;Collage_4x5;Collage_4x6;Collage_5x2;Collage_5x3;Collage_5x4;Collage_5x5;Collage_5x6;Collage_6x2;Collage_6x3;Collage_6x4;Collage_6x5;Collage_8x3
Encoding=UTF-8 
X-KDE-Priority=TopLevel 
X-KDE-Submenu=Bilder-Collagen (Color) erstellen
 
[Desktop Action Collage_1x2]
Icon=image-jpeg
Name=1x2 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 1x2 %U"
 
[Desktop Action Collage_1x3]
Icon=image-jpeg
Name=1x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 1x3 %U"
 
[Desktop Action Collage_2x1]
Icon=image-jpeg
Name=2x1 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 2x1 %U"
 
[Desktop Action Collage_2x2]
Icon=image-jpeg
Name=2x2 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 2x2 %U"
 
[Desktop Action Collage_2x3]
Icon=image-jpeg
Name=2x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 2x3 %U"
 
[Desktop Action Collage_2x4]
Icon=image-jpeg
Name=2x4 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 2x4 %U"
 
[Desktop Action Collage_3x1]
Icon=image-jpeg
Name=3x1 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x1 %U"
 
[Desktop Action Collage_3x2]
Icon=image-jpeg
Name=3x2 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x2 %U"
 
[Desktop Action Collage_3x3]
Icon=image-jpeg
Name=3x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x3 %U"
 
[Desktop Action Collage_3x4]
Icon=image-jpeg
Name=3x4 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x4 %U"
 
[Desktop Action Collage_3x5]
Icon=image-jpeg
Name=3x5 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x5 %U"
 
[Desktop Action Collage_3x6]
Icon=image-jpeg
Name=3x6 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 3x6 %U"
 
[Desktop Action Collage_4x3]
Icon=image-jpeg
Name=4x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 4x3 %U"
 
[Desktop Action Collage_4x4]
Icon=image-jpeg
Name=4x4 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 4x4 %U"
 
[Desktop Action Collage_4x5]
Icon=image-jpeg
Name=4x5 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 4x5 %U"
 
[Desktop Action Collage_4x6]
Icon=image-jpeg
Name=4x6 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 4x6 %U"
 
[Desktop Action Collage_5x2]
Icon=image-jpeg
Name=5x2 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 5x2 %U"
 
[Desktop Action Collage_5x3]
Icon=image-jpeg
Name=5x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 5x3 %U"
 
[Desktop Action Collage_5x4]
Icon=image-jpeg
Name=5x4 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 5x4 %U"
 
[Desktop Action Collage_5x5]
Icon=image-jpeg
Name=5x5 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 5x5 %U"
 
[Desktop Action Collage_5x6]
Icon=image-jpeg
Name=5x6 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 5x6 %U"
 
[Desktop Action Collage_6x2]
Icon=image-jpeg
Name=6x2 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 6x2 %U"
 
[Desktop Action Collage_6x3]
Icon=image-jpeg
Name=6x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 6x3 %U"
 
[Desktop Action Collage_6x4]
Icon=image-jpeg
Name=6x4 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 6x4 %U"
 
[Desktop Action Collage_6x5]
Icon=image-jpeg
Name=6x5 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 6x5 %U"
 
[Desktop Action Collage_8x3]
Icon=image-jpeg
Name=8x3 Bilder auf Full-HD-Aulösung
Exec=/usr/bin/uxterm -e "/usr/local/scripts/create_collage.sh -g no -r 8x3 %U"
create_collage.sh
#!/bin/bash
#
#
########## Variablendefinitionen ##########
ALL=$@
POSITION=$(expr `expr index "$ALL" "/"` - 1)
FILE_ALL=${ALL:$POSITION}
FILE_COUNTER=$(expr $# - 4)
FILE_MINI="ReSized"
 
########## Funktionsdefinitionen ##########
 
do_print_debug()
{
	echo ""
	echo "--------------- Debugging an ----------------"
	echo ""
	echo "ALL          = "$ALL
	echo "POSITION     = "$POSITION
	echo "FILE_ALL     = "$FILE_ALL
	echo "FILE_COUNTER = "$FILE_COUNTER
	echo "COUNTER      = "$COUNTER
	echo ""
	echo "--------------- Debugging aus ---------------"
	echo ""
}
 
 
do_show_files()
{
	echo " --> Verarbeite $FILE_COUNTER Dateien ..."
	COUNTER=1
	for ROW in $FILE_ALL
		do
		echo "     "$ROW" ($COUNTER)"
		COUNTER=$(( $COUNTER + 1 ))
	done
}
 
 
do_convert_to_grayscale_files()
{
	if [ "$FILE_EDITED" = "GrayScaled" ]
		then
		echo ""
		echo " --> Konvertiere ausgewählte Bilder nach S/W ..."
		convert collage_$GRID.jpg -colorspace Gray collage_"$FILE_EDITED"_$GRID.jpg
		RC=$?
		do_print_rc_message $RC
	elif [ "$FILE_EDITED" = "UnChanged" ]
		then
		echo ""
		echo " --> Ausgewählte Bilder bleiben unverändert ..."
		mv collage_$GRID.jpg collage_"$FILE_EDITED"_$GRID.jpg
		RC=$?
		do_print_rc_message $RC
	fi
}
 
 
do_del_metadata_from_files()
{
	echo ""
	echo " --> Metadaten (EXIF etc.) in den temporären Bilder entfernen ..."
	jhead -de -di -dx -q $FILE_MINI-*.jpg
	RC=$?
	do_print_rc_message $RC
}
 
 
do_resize_files()
{
	echo ""
	echo " --> Größenanpassung der Bilder an das ausgewählte Format ..."
	convert -resize $RESOLUTION $FILE_ALL $FILE_MINI.jpg
	RC=$?
	do_print_rc_message $RC
}
 
 
do_montage_files()
{
	echo ""
	echo " --> Ausgwewählte Bilder zur Collage zusammenstellen ..."
	montage -tile $COLUMN -geometry 100% "$FILE_MINI-*" collage_"$GRID".jpg
	RC=$?
	do_print_rc_message $RC
}
 
 
do_set_montage_param()
{
	if [ "$GRID" = "1x2" ]
		then
		RESOLUTION="1920x600!"
		COLUMN="1"
	elif [ "$GRID" = "1x3" ]
		then
		RESOLUTION="1920x400!"
		COLUMN="1"
	elif [ "$GRID" = "2x1" ]
		then
		RESOLUTION="960x1200!"
		COLUMN="2"
	elif [ "$GRID" = "2x2" ]
		then
		RESOLUTION="960x600!"
		COLUMN="2"
	elif [ "$GRID" = "2x3" ]
		then
		RESOLUTION="960x400!"
		COLUMN="2"
	elif [ "$GRID" = "2x4" ]
		then
		RESOLUTION="960x300!"
		COLUMN="2"
	elif [ "$GRID" = "3x1" ]
		then
		RESOLUTION="640x1200!"
		COLUMN="3"
	elif [ "$GRID" = "3x2" ]
		then
		RESOLUTION="640x600!"
		COLUMN="3"
	elif [ "$GRID" = "3x3" ]
		then
		RESOLUTION="640x400!"
		COLUMN="3"
	elif [ "$GRID" = "3x4" ]
		then
		RESOLUTION="640x300!"
		COLUMN="3"
	elif [ "$GRID" = "3x5" ]
		then
		RESOLUTION="640x240!"
		COLUMN="3"
	elif [ "$GRID" = "3x6" ]
		then
		RESOLUTION="640x200!"
		COLUMN="3"
	elif [ "$GRID" = "4x3" ]
		then
		RESOLUTION="480x400!"
		COLUMN="4"
	elif [ "$GRID" = "4x4" ]
		then
		RESOLUTION="480x300!"
		COLUMN="4"
	elif [ "$GRID" = "4x5" ]
		then
		RESOLUTION="480x240!"
		COLUMN="4"
	elif [ "$GRID" = "4x6" ]
		then
		RESOLUTION="480x200!"
		COLUMN="4"
	elif [ "$GRID" = "5x2" ]
		then
		RESOLUTION="384x600!"
		COLUMN="5"
	elif [ "$GRID" = "5x3" ]
		then
		RESOLUTION="384x400!"
		COLUMN="5"
	elif [ "$GRID" = "5x4" ]
		then
		RESOLUTION="384x300!"
		COLUMN="5"
	elif [ "$GRID" = "5x5" ]
		then
		RESOLUTION="384x240!"
		COLUMN="5"
	elif [ "$GRID" = "5x6" ]
		then
		RESOLUTION="384x200!"
		COLUMN="5"
	elif [ "$GRID" = "6x2" ]
		then
		RESOLUTION="320x600!"
		COLUMN="6"
	elif [ "$GRID" = "6x3" ]
		then
		RESOLUTION="320x400!"
		COLUMN="6"
	elif [ "$GRID" = "6x4" ]
		then
		RESOLUTION="320x300!"
		COLUMN="6"
	elif [ "$GRID" = "6x5" ]
		then
		RESOLUTION="320x240!"
		COLUMN="6"
	elif [ "$GRID" = "8x3" ]
		then
		RESOLUTION="240x400!"
		COLUMN="8"
	else
		echo "Falschen Wert ($GRID) angegeben!"
		exit 2
	fi
}
 
 
do_del_temp_files()
{
	echo ""
	echo " --> Lösche temporäre Dateien ..."
 
	for FILE_DEL in $FILE_MINI-*.jpg
		do
		if [ -e $FILE_DEL ]
			then
			rm $FILE_DEL
			RC=$?
		else
			RC="1"
		fi
	done
	do_print_rc_message $RC
 
	if [ -e collage_$GRID.jpg ]
		then
		rm collage_$GRID.jpg
		RC=$?
		do_print_rc_message $RC
	fi
}
 
 
do_print_rc_message()
{
	if [ $1 -eq 0 ]
		then
		echo "     --> OKAY"
	elif [ $1 -gt 0 ]
		then
		echo "     --> ERROR"
	fi
}
 
 
do_check_marked_files()
{
	ROW=""
	POS_OF_X=$(expr index "$GRID" x)
	ROW=${GRID:POS_OF_X}
	FROM_BEGIN=$(expr $(expr index "$GRID" x) - 1)
	COL=${GRID:0:FROM_BEGIN}
	FILES_CALCULATED=$(($COL * $ROW))
 
	if [ $FILE_COUNTER -lt $FILES_CALCULATED ]
		then
		echo ""
		echo " --> Zu wenige Dateien ($FILE_COUNTER) markiert. Für das Format $GRID werden $FILES_CALCULATED Dateien benötigt"
		RC="1"
		do_print_rc_message $RC
		break
	elif [ $FILE_COUNTER -gt $FILES_CALCULATED ]
		then
		echo ""
		echo " --> Zu viele Dateien ($FILE_COUNTER) markiert. Für das Format $GRID werden $FILES_CALCULATED Dateien benötigt"
		RC="1"
		do_print_rc_message $RC
		break
	elif [ $FILES_CALCULATED -eq $FILE_COUNTER ]
		then
		echo ""
		echo " --> Anzahl der Dateien ($FILE_COUNTER) für das gewählte Format $GRID ist korrekt"
		RC="0"
		do_print_rc_message $RC
	fi
}
 
 
usage()
{
	echo "Syntax: $0 [-h | -g | -r <Spalten_Zeilen>]"
	echo ""
	echo " -h (help):           diese Hilfeseite"
	echo " -g (grayscale):      S/W-Bilder in Collage verwenden"
	echo " -r (raster):         Angabe der verwendeten Bilder in Spalten x Zeilen"
	echo ""
	exit 1
}
 
if [ $# -eq 0 ]; then
	usage
fi
 
########## Hauptprogramm ##########
while getopts hg:r:lf: OPTION
	do
	case $OPTION in
		h)
		usage
		;;
 
		g)
		if [ "$OPTARG" = "yes" ]
			then
			FILE_EDITED="GrayScaled"
		elif [ "$OPTARG" = "no" ]
			then
			FILE_EDITED="UnChanged"
		else
			echo " --> Argument $OPTARG unbekannt"
			break
		fi
		;;
 
		r)
		GRID=$OPTARG
		do_show_files
		do_check_marked_files
		do_set_montage_param		
		do_resize_files
		do_del_metadata_from_files
		do_montage_files
		do_convert_to_grayscale_files
		do_del_temp_files
		;;
 
		\?)
		echo "Falsche Option $OPTION angegeben!"
		;;
	esac
done
shift `expr $OPTIND - 1`
 
echo ""
echo " Fenster schließen mit Taste RETURN"
read ret
exit 0
#EOF
collagenbildererstellencolor.txt · Zuletzt geändert: 2020/01/28 17:38 von dwadmin