diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-28 21:50:19 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-05-28 21:50:19 +0200 |
commit | 3021a6e12adbcfb8583d04914fecda4816f1d5b1 (patch) | |
tree | 9411cc7f1e6578afc64099cab4813167f0c67cfa /phpBB/develop | |
parent | e2308df14d61c91ab93a6da191b7df6f83ee5af8 (diff) | |
parent | 97dc817158fe88ce5d336b6147d355989efde044 (diff) | |
download | forums-3021a6e12adbcfb8583d04914fecda4816f1d5b1.tar forums-3021a6e12adbcfb8583d04914fecda4816f1d5b1.tar.gz forums-3021a6e12adbcfb8583d04914fecda4816f1d5b1.tar.bz2 forums-3021a6e12adbcfb8583d04914fecda4816f1d5b1.tar.xz forums-3021a6e12adbcfb8583d04914fecda4816f1d5b1.zip |
Merge pull request #2505 from bantu/ticket/12582-ascraeus
[ticket/12582] Strip away copyrighted ICC profile from images
* bantu/ticket/12582-ascraeus:
[ticket/12582] Use the correct script name.
[ticket/12582] Fix coding style.
[ticket/12582] Remove set -e due to exiftool not liking 0 byte files.
[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.
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..779c7ffca7 --- /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 +# + +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 |