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 | |
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
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | phpBB/adm/images/phpbb_logo.png | bin | 9313 -> 6662 bytes | |||
-rwxr-xr-x | phpBB/develop/strip_icc_profiles.sh | 26 | ||||
-rwxr-xr-x | travis/check-image-icc-profiles.sh | 15 | ||||
-rwxr-xr-x | travis/setup-exiftool.sh | 9 | ||||
-rwxr-xr-x | travis/setup-phpbb.sh | 5 |
6 files changed, 56 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 0ac1464540..e608a3f514 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ before_script: script: - travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION + - travis/check-icc-profiles.sh $DB $TRAVIS_PHP_VERSION - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi" diff --git a/phpBB/adm/images/phpbb_logo.png b/phpBB/adm/images/phpbb_logo.png Binary files differindex c3f9248ed7..2d76ef18cb 100644 --- a/phpBB/adm/images/phpbb_logo.png +++ b/phpBB/adm/images/phpbb_logo.png 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 diff --git a/travis/check-image-icc-profiles.sh b/travis/check-image-icc-profiles.sh new file mode 100755 index 0000000000..fa9300012a --- /dev/null +++ b/travis/check-image-icc-profiles.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e + +DB=$1 +TRAVIS_PHP_VERSION=$2 + +if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] +then + find . -type f -not -path './phpBB/vendor/*' -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' | \ + parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}' +fi diff --git a/travis/setup-exiftool.sh b/travis/setup-exiftool.sh new file mode 100755 index 0000000000..55bcda6c9f --- /dev/null +++ b/travis/setup-exiftool.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# @copyright (c) 2014 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e + +sudo apt-get update +sudo apt-get install -y parallel libimage-exiftool-perl diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index f079a0a6b7..fe57d2f238 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -9,6 +9,11 @@ set -x DB=$1 TRAVIS_PHP_VERSION=$2 +if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ] +then + travis/setup-exiftool.sh +fi + if [ "$DB" == "mariadb" ] then travis/setup-mariadb.sh |