2014-05-27 01:13:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# @copyright (c) 2014 phpBB Group
|
|
|
|
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
|
|
#
|
|
|
|
|
2014-05-27 20:56:29 +02:00
|
|
|
if [ "$#" -ne 1 ]
|
|
|
|
then
|
2014-05-27 16:56:45 +02:00
|
|
|
SCRIPT=$(basename "$0")
|
|
|
|
echo "Description: Finds and strips ICC Profiles from given image file." >&2
|
|
|
|
echo "Usage: $SCRIPT /path/to/image/file" >&2
|
2014-05-27 01:13:22 +02:00
|
|
|
echo "Exit Status: 0 if no ICC profiles have been stripped, otherwise 1." >&2
|
|
|
|
echo "Requires: exiftool" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-05-27 16:56:45 +02:00
|
|
|
FILE=$1
|
|
|
|
HASH_OLD=$(md5sum "$FILE")
|
|
|
|
exiftool -icc_profile"-<=" -overwrite_original_in_place "$FILE" > /dev/null 2>&1
|
|
|
|
HASH_NEW=$(md5sum "$FILE")
|
2014-05-27 01:13:22 +02:00
|
|
|
|
2014-05-27 16:56:45 +02:00
|
|
|
if [ "$HASH_OLD" != "$HASH_NEW" ]
|
|
|
|
then
|
|
|
|
echo "Stripped ICC Profile from $FILE."
|
|
|
|
exit 1
|
|
|
|
fi
|