mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
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
This commit is contained in:
26
phpBB/develop/strip_icc_profiles.sh
Executable file
26
phpBB/develop/strip_icc_profiles.sh
Executable file
@@ -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
|
Reference in New Issue
Block a user