aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-05-27 16:56:45 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-05-27 17:23:54 +0200
commitc02fba3f1c17bd5ffd780409a64a612a0e6d1d03 (patch)
treee5fec752b2cea4f38a66a3c5df82c98874b5b6d9 /phpBB/develop
parent4f9aa5e3843eb4e8e6b808b294b81649e1c435f3 (diff)
downloadforums-c02fba3f1c17bd5ffd780409a64a612a0e6d1d03.tar
forums-c02fba3f1c17bd5ffd780409a64a612a0e6d1d03.tar.gz
forums-c02fba3f1c17bd5ffd780409a64a612a0e6d1d03.tar.bz2
forums-c02fba3f1c17bd5ffd780409a64a612a0e6d1d03.tar.xz
forums-c02fba3f1c17bd5ffd780409a64a612a0e6d1d03.zip
[ticket/12582] Change strip_icc_profiles.sh to only take a single file.
PHPBB3-12582
Diffstat (limited to 'phpBB/develop')
-rwxr-xr-xphpBB/develop/strip_icc_profiles.sh31
1 files changed, 12 insertions, 19 deletions
diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh
index 5bf602242a..69431fbac2 100755
--- a/phpBB/develop/strip_icc_profiles.sh
+++ b/phpBB/develop/strip_icc_profiles.sh
@@ -4,30 +4,23 @@
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
#
set -e
-set -x
-SCRIPT=$(basename "$0")
if [ "$#" -ne 1 ]; then
- echo "Description: Finds and strips ICC Profiles from image files." >&2
- echo "Usage: $SCRIPT /root/directory" >&2
+ SCRIPT=$(basename "$0")
+ echo "Description: Finds and strips ICC Profiles from given image file." >&2
+ echo "Usage: $SCRIPT /path/to/image/file" >&2
echo "Exit Status: 0 if no ICC profiles have been stripped, otherwise 1." >&2
echo "Requires: exiftool" >&2
exit 1
fi
-ROOT=$1
-STATUS=0
-for FILE in $(find "$ROOT" -type f -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$')
-do
- HASH_OLD=$(md5sum "$FILE")
- exiftool -icc_profile"-<=" -overwrite_original_in_place "$FILE" > /dev/null 2>&1
- HASH_NEW=$(md5sum "$FILE")
+FILE=$1
+HASH_OLD=$(md5sum "$FILE")
+exiftool -icc_profile"-<=" -overwrite_original_in_place "$FILE" > /dev/null 2>&1
+HASH_NEW=$(md5sum "$FILE")
- if [ "$HASH_OLD" != "$HASH_NEW" ]
- then
- echo "Stripped ICC Profile from $FILE."
- STATUS=1
- fi
-done
-
-exit $STATUS
+if [ "$HASH_OLD" != "$HASH_NEW" ]
+then
+ echo "Stripped ICC Profile from $FILE."
+ exit 1
+fi