From 844745700775a1dd933f01de4563fd2d7a79b427 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 May 2016 22:55:41 +0300 Subject: Add into ci scripts images format check with pngcheck. --- .tools/init.sh | 3 ++- .tools/pngcheck.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 .tools/pngcheck.sh (limited to '.tools') diff --git a/.tools/init.sh b/.tools/init.sh index 0315f39a..99f85e70 100755 --- a/.tools/init.sh +++ b/.tools/init.sh @@ -2,7 +2,8 @@ function check_error { if [ "$1" != 0 ]; then - exit $result + echo "Error $1" + exit $1 fi } diff --git a/.tools/pngcheck.sh b/.tools/pngcheck.sh new file mode 100755 index 00000000..a95225e8 --- /dev/null +++ b/.tools/pngcheck.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +source ./.tools/init.sh + +aptget_update +aptget_install pngcheck + +export LOG1="pngcheck.log" +export LOG2="pngcheck2.log" + +rm ${LOG1} +rm ${LOG2} + +find . -type f -name "*.png" -exec pngcheck {} \; >${LOG1} + +grep -v "32-bit RGB+alpha, non-interlaced, " ${LOG1} >${LOG2} +export DATA=$(cat pngcheck2.log) +if [[ -n "${DATA}" ]]; then + echo "Images must be in 32 bit RGBA and non-interlanced" + echo "Wrong images format found:" + cat ${LOG2} + exit 1 +fi -- cgit v1.2.3-60-g2f50