Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- rootdir="."
- background_file_name="background.jpg"
- if [ $# -eq 2 ]; then
- rootdir=$1
- background_file_name=$2
- elif [ $# -eq 1 ]; then
- rootdir="."
- background_file_name=$1
- fi
- find "$rootdir" -type d | while read pngdir; do
- if [ -f "$pngdir/$background_file_name" ];
- then
- echo "Background file found in $pngdir/$background_file_name"
- find "$pngdir" -name *.png -maxdepth 1 | while read foreground_file; do
- echo "processing $foreground_file with $pngdir/$background_file_name"
- mkdir -p "$pngdir/merged"
- ./composite -gravity center -compress Lossless "$foreground_file" "$pngdir/$background_file_name" "$pngdir/merged/`basename -s .png \"$foreground_file\"`.jpg"
- done
- fi
- done
Add Comment
Please, Sign In to add comment