From: Rudolf Polzer Date: Sun, 7 Nov 2010 17:26:56 +0000 (+0100) Subject: more fixes X-Git-Tag: xonotic-v0.1.0preview~74 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4fa626743180526627ffc054951fa09f10e9fa91;p=xonotic%2Fxonotic.git more fixes --- diff --git a/misc/tools/cached-converter.sh b/misc/tools/cached-converter.sh index be4d5b6d..8827a50f 100755 --- a/misc/tools/cached-converter.sh +++ b/misc/tools/cached-converter.sh @@ -104,7 +104,7 @@ reduce_jpeg2_jpeg2() cp "$i" "$o" fi else - return 0 + return 1 fi if convert "$ia" TGA:- | cjpeg -targa -quality "$2" -optimize -sample 1x1,1x1,1x1 > "$oa"; then if [ "`stat -c %s "$ia"`" -lt "`stat -c %s "$oa"`" ]; then @@ -124,7 +124,7 @@ reduce_jpeg_jpeg() cp "$i" "$o" fi else - return 0 + return 1 fi } @@ -158,12 +158,12 @@ reduce_rgba_jpeg2() i=$1; shift; shift o=$1; shift oa=$1; shift - if convert "$i" TGA:- | cjpeg -targa -quality "$1" -optimize -sample 1x1,1x1,1x1 > "$o"; then + if convert "$i" -alpha off TGA:- | cjpeg -targa -quality "$1" -optimize -sample 1x1,1x1,1x1 > "$o"; then : else - return 0 + return 1 fi - if convert "$ia" TGA:- | cjpeg -targa -quality "$2" -optimize -sample 1x1,1x1,1x1 > "$oa"; then + if convert "$i" -alpha extract TGA:- | cjpeg -targa -quality "$2" -optimize -sample 1x1,1x1,1x1 > "$oa"; then : else return 1 @@ -185,7 +185,7 @@ reduce_rgb_jpeg() if convert "$i" TGA:- | cjpeg -targa -quality "$1" -optimize -sample 1x1,1x1,1x1 > "$o"; then : else - return 0 + return 1 fi } @@ -193,7 +193,7 @@ has_alpha() { i=$1; shift; shift o=$1; shift; shift - if convert "$F" -depth 16 RGBA:- | perl -e 'while(read STDIN, $_, 8) { substr($_, 6, 2) eq "\xFF\xFF" or exit 1; } exit 0;'; then + if convert "$i" -depth 16 RGBA:- | perl -e 'while(read STDIN, $_, 8) { substr($_, 6, 2) eq "\xFF\xFF" or exit 1; } exit 0;'; then # no alpha : > "$o" else