projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b55d415
)
Fixed a bug in the png_recompress.sh script
author
Arvid Norlander
<anmaster@berlios.de>
Sat, 19 May 2007 16:47:52 +0000
(16:47 +0000)
committer
Arvid Norlander
<anmaster@berlios.de>
Sat, 19 May 2007 16:47:52 +0000
(16:47 +0000)
SVN-Revision: 5004
tools/png_recompress.sh
patch
|
blob
|
history
diff --git
a/tools/png_recompress.sh
b/tools/png_recompress.sh
index
b38cb7d
..
f515536
100755
(executable)
--- a/
tools/png_recompress.sh
+++ b/
tools/png_recompress.sh
@@
-66,7
+66,7
@@
for image in "$@"; do
echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')"
newsize="$(pngcrush -reduce -brute -d "$TMPPATH" "$image" | grep -E "filesize reduction")"
echo "$newsize"
echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')"
newsize="$(pngcrush -reduce -brute -d "$TMPPATH" "$image" | grep -E "filesize reduction")"
echo "$newsize"
- if
[[ $newsize =~ ".+reduction.+" ]]
; then
+ if
grep -q reduction <<< "$newsize"
; then
cp -v "${TMPPATH}/$fname" "$dname/$fname"
else
rm -v "${TMPPATH}/$fname"
cp -v "${TMPPATH}/$fname" "$dname/$fname"
else
rm -v "${TMPPATH}/$fname"
@@
-83,7
+83,7
@@
for image in "$@"; do
echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')"
newsize="$(optipng -i 0 -o 7 -dir "$TMPPATH" "$image" | grep -E '^Output file size')"
echo "$newsize"
echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')"
newsize="$(optipng -i 0 -o 7 -dir "$TMPPATH" "$image" | grep -E '^Output file size')"
echo "$newsize"
- if
[[ $newsize =~ ".+decrease.+" ]]
; then
+ if
grep -q decrease <<< "$newsize"
; then
cp -v "${TMPPATH}/$fname" "$dname/$fname"
else
rm -v "${TMPPATH}/$fname"
cp -v "${TMPPATH}/$fname" "$dname/$fname"
else
rm -v "${TMPPATH}/$fname"