From af05015a693ef28cf6a38e449a375d4593a41253 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 May 2014 01:13:22 +0200 Subject: [ticket/12582] Add script for strippping ICC profiles from images. PHPBB3-12582 --- phpBB/develop/strip_icc_profiles.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 phpBB/develop/strip_icc_profiles.sh (limited to 'phpBB') diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh new file mode 100755 index 0000000000..c9c77bda38 --- /dev/null +++ b/phpBB/develop/strip_icc_profiles.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# @copyright (c) 2014 phpBB Group +# @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 + 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"-<=" "$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 -- cgit v1.2.1 From ac3bc458742d662199079c291a051b1fa7f41b1a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 May 2014 01:21:02 +0200 Subject: [ticket/12582] Overwrite inplace instead of creating _original files. PHPBB3-12582 --- phpBB/develop/strip_icc_profiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB') diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh index c9c77bda38..5bf602242a 100755 --- a/phpBB/develop/strip_icc_profiles.sh +++ b/phpBB/develop/strip_icc_profiles.sh @@ -20,7 +20,7 @@ STATUS=0 for FILE in $(find "$ROOT" -type f -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$') do HASH_OLD=$(md5sum "$FILE") - exiftool -icc_profile"-<=" "$FILE" > /dev/null 2>&1 + exiftool -icc_profile"-<=" -overwrite_original_in_place "$FILE" > /dev/null 2>&1 HASH_NEW=$(md5sum "$FILE") if [ "$HASH_OLD" != "$HASH_NEW" ] -- cgit v1.2.1 From c02fba3f1c17bd5ffd780409a64a612a0e6d1d03 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 May 2014 16:56:45 +0200 Subject: [ticket/12582] Change strip_icc_profiles.sh to only take a single file. PHPBB3-12582 --- phpBB/develop/strip_icc_profiles.sh | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'phpBB') 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 -- cgit v1.2.1 From b485318ba9e9831c87e7c33decf80bf74f350125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Wed, 21 May 2014 17:16:23 -0400 Subject: [ticket/12582] Strip away copyrighted ICC profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This images embed a non free ICC profile that doesn’t allow modification: http://web.archive.org/web/20020603153925/srgb.com/usingsrgb.html Please use the proposed version stripping away this copyrighted binary profile, probably embedded by an image software at one time: exiftool -icc_profile"-<=" phpBB/adm/images/phpbb_logo.png I’ve checked the resulting image and trust it is identical to the original. Some more background on the issue: https://lists.debian.org/debian-devel/2014/05/msg00339.html PHPBB3-12582 --- phpBB/adm/images/phpbb_logo.png | Bin 9313 -> 6662 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'phpBB') diff --git a/phpBB/adm/images/phpbb_logo.png b/phpBB/adm/images/phpbb_logo.png index c3f9248ed7..2d76ef18cb 100644 Binary files a/phpBB/adm/images/phpbb_logo.png and b/phpBB/adm/images/phpbb_logo.png differ -- cgit v1.2.1