aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-05-28 21:49:54 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-05-28 21:49:54 +0200
commitf09799322e0248bca09364f147b65d59c57941f5 (patch)
treeb23e72dd92e7fcc5f2eedc90610c0ccb8cd4d189
parentac3e0e53b2b7f118cbe4e6ee20109090ecfce3f8 (diff)
parentde71837b711ec076e2bf9c3a4b2f6a5bc3c56030 (diff)
downloadforums-f09799322e0248bca09364f147b65d59c57941f5.tar
forums-f09799322e0248bca09364f147b65d59c57941f5.tar.gz
forums-f09799322e0248bca09364f147b65d59c57941f5.tar.bz2
forums-f09799322e0248bca09364f147b65d59c57941f5.tar.xz
forums-f09799322e0248bca09364f147b65d59c57941f5.zip
Merge pull request #2498 from bantu/ticket/12582
[ticket/12582] Strip away copyrighted ICC profile from images * bantu/ticket/12582: [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.
-rw-r--r--.travis.yml2
-rw-r--r--phpBB/adm/images/phpbb_logo.pngbin9313 -> 6662 bytes
-rwxr-xr-xphpBB/develop/strip_icc_profiles.sh26
3 files changed, 28 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 26744c57ef..0358500adc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,10 +22,12 @@ before_script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev --no-interaction --prefer-source; fi"
- cd ..
- sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then sudo apt-get update; sudo apt-get install -y parallel libimage-exiftool-perl; fi"
script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then phpunit --configuration travis/phpunit-$DB-5-2-travis.xml; else phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysql' ]; then find . -type f -not -path './phpBB/vendor/*' -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' | parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}' || exit 1; fi"
matrix:
include:
diff --git a/phpBB/adm/images/phpbb_logo.png b/phpBB/adm/images/phpbb_logo.png
index c3f9248ed7..2d76ef18cb 100644
--- a/phpBB/adm/images/phpbb_logo.png
+++ b/phpBB/adm/images/phpbb_logo.png
Binary files differ
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