From 009aa9eb6a04fa80e66f45523ae33fef0cb31e19 Mon Sep 17 00:00:00 2001 From: jmschrack Date: Fri, 2 Dec 2016 11:45:19 -0600 Subject: [PATCH] Fixed inability to disable dziFormat -d / --dziFormat was hardcoded to set dziFormat to true. dziFormat is already defaulted to true. Changed to -d takes boolean true/false. In sliceImage "if [ ! dziFormat ] " was testing if the variable was unset on some shells. Changed to string comparison for greater portability. --- magick-slicer.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/magick-slicer.sh b/magick-slicer.sh index 27a3ee4..940ddc5 100755 --- a/magick-slicer.sh +++ b/magick-slicer.sh @@ -484,7 +484,8 @@ do ;; -d|--dzi) - dziFormat=true + dziFormat="$2" + shift # past argument ;; -a|--slicea) @@ -721,7 +722,7 @@ sliceImage(){ # zoom image local tilesFormat="%[fx:page.x/${tileW}]${xyDelim}%[fx:page.y/${tileH}]" # This very important magic! It allow imagemagick to generate tile names with it position and place it in corect folders (but folders need to generate manually) local file="${resultDir}/${zoom}/%[filename:tile].${resultExt}" - if [ ! $dziFormat ] + if [ "$dziFormat" = false ] then # Creating subdirectories for tiles (one vertical line of tiles is in one folder) local srcSize=`getImgW $src` # Getting image width