]> git.sommitrealweird.co.uk Git - bpgallery.git/commitdiff
* Check image exists in size matching code
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 25 May 2010 08:41:43 +0000 (09:41 +0100)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Tue, 25 May 2010 08:42:38 +0000 (09:42 +0100)
bpgallery.sh

index 4f421c9f0116765f7f1a99b59ccfb4ecf427cab9..dc8780f486cf301b8d806c705222c78d1454250c 100755 (executable)
@@ -543,6 +543,10 @@ function check_dimensions() {
        wantedheight=$2
        dir=$3
        filename=$4
        wantedheight=$2
        dir=$3
        filename=$4
+       if [ ! -e "$dir/$filename" ]; then
+               echo 0
+               return
+       fi
        iconwidth=$($IDENTIFYCOMMAND -format "%wx%h" "$dir/$filename")
        iconheight=${iconwidth//*x}
        iconwidth=${iconwidth//x*}
        iconwidth=$($IDENTIFYCOMMAND -format "%wx%h" "$dir/$filename")
        iconheight=${iconwidth//*x}
        iconwidth=${iconwidth//x*}