diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-05-27 20:38:20 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-05-27 20:38:20 +0200 |
commit | a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa (patch) | |
tree | d80239083ccf4556d2040ae1d9fc879411d297d4 /phpBB/develop | |
parent | 0acaa7722956635b8f17e19cddc6f02a602b7352 (diff) | |
parent | b485318ba9e9831c87e7c33decf80bf74f350125 (diff) | |
download | forums-a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa.tar forums-a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa.tar.gz forums-a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa.tar.bz2 forums-a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa.tar.xz forums-a1e31f4389961bc32e9e9dfaa3f0ac21331f10aa.zip |
Merge branch 'ticket/12582' into ticket/12582-ascraeus
* ticket/12582:
[ticket/12582] Strip away copyrighted ICC profile
[ticket/12582] Change strip_icc_profiles.sh to only take a single file.
[ticket/12582] Run strip_icc_profiles.sh on Travis CI.
[ticket/12582] Overwrite inplace instead of creating _original files.
[ticket/12582] Add script for strippping ICC profiles from images.
Conflicts:
.travis.yml
Diffstat (limited to 'phpBB/develop')
-rwxr-xr-x | phpBB/develop/strip_icc_profiles.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh new file mode 100755 index 0000000000..69431fbac2 --- /dev/null +++ b/phpBB/develop/strip_icc_profiles.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e + +if [ "$#" -ne 1 ]; then + 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 + +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." + exit 1 +fi |