From e1f833a400ee3d35732795949fb64d8f0b9004d8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Thu, 27 Aug 2015 16:34:52 -0400 Subject: [PATCH] Fix remove-bg script to work on filenames with spaces --- rsrc/remove-bg/remove-bg.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rsrc/remove-bg/remove-bg.sh b/rsrc/remove-bg/remove-bg.sh index aae07408..3a71f2de 100755 --- a/rsrc/remove-bg/remove-bg.sh +++ b/rsrc/remove-bg/remove-bg.sh @@ -50,7 +50,7 @@ if [ -z `which convert` ]; then exit fi -if [ ! -e $2 -o ! -e $3 -o ! -e $4 ]; then +if [ ! -e "$2" -o ! -e "$3" -o ! -e "$4" ]; then echo 'Error! Could not find one of the input files!' echo 'Make sure you spelled them all correctly.' exit @@ -58,10 +58,10 @@ fi convert \ -size $1 canvas:white -alpha set \ - $2 $3 -channel A -fx "@calc-alpha.fx" \ - $2 $3 -channel RGB -fx "@apply-alpha.fx" \ + "$2" "$3" -channel A -fx "@calc-alpha.fx" \ + "$2" "$3" -channel RGB -fx "@apply-alpha.fx" \ intermediate.png 2>| im_error.txt -convert intermediate.png $3 $4 -composite $5 +convert intermediate.png "$3" "$4" -composite "$5" rm intermediate.png