accomodate blank spaces in filename while converting
This commit is contained in:
parent
c24a0baad7
commit
406f2837d5
|
@ -19,7 +19,6 @@ mkdir -p /tmp/kra-output
|
|||
for f in *.kra
|
||||
do
|
||||
echo "processing file - $f"
|
||||
|
||||
#unzip the merged png image inside kra file
|
||||
unzip -j "$f" "mergedimage.png" -d "/tmp/kra-output/" > /dev/null 2>&1
|
||||
|
||||
|
@ -27,13 +26,13 @@ unzip -j "$f" "mergedimage.png" -d "/tmp/kra-output/" > /dev/null 2>&1
|
|||
#check wether user has given resize parameter as an argument
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove -resize "$1"% -quality 95 "$cwd"/output/lowres/${f%.*}-lowres.jpg
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove -resize "$1"% -quality 95 "$cwd"/output/lowres/"${f%.*}"-lowres.jpg
|
||||
#else use default 40% resize value
|
||||
else
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove -resize 40% -quality 95 "$cwd"/output/lowres/${f%.*}-lowres.jpg
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove -resize 40% -quality 95 "$cwd"/output/lowres/"${f%.*}"-lowres.jpg
|
||||
fi
|
||||
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove "$cwd"/output/hires/${f%.*}-hires.png
|
||||
convert /tmp/kra-output/mergedimage.png -colorspace sRGB -background white -alpha remove "$cwd"/output/hires/"${f%.*}"-hires.png
|
||||
|
||||
#remove the output image (need to find better way to do this)
|
||||
rm /tmp/kra-output/mergedimage.png
|
||||
|
|
Loading…
Reference in New Issue