Feature #19748
closedImageMagick generates larger than necessary files
0%
Description
IM preserves image profile information unless '-strip' option is specified. More info:
http://www.imagemagick.org/Usage/thumbnails/#profiles
http://www.imagemagick.org/www/command-line-options.html#strip
Patch:
t3lib/class.t3lib_div.php:5074
INSTEAD:
$cmdLine = $path.' '.$parameters;
PUT:
$cmdLine = $path.' -strip '.$parameters;
(issue imported from #M10025)
Files
Updated by John Angel almost 16 years ago
Here is the example: when creating 40x40 thumbnail from certain (not all) 70 kb jpegs, without –strip the result was 22 kb jpeg. With -strip it is 1 kb.
Updated by John Angel almost 16 years ago
We can make this option configurable:
$GLOBALS['TYPO3_CONF_VARS']['GFX']['strip_all_images'] = 1 or 0
So instead of:
$cmdLine = $path.' '.$parameters;
use:
$cmdLine = $path.($gfxConf['strip_all_images'] ? ' -strip ' : '').$parameters;
Updated by John Angel almost 16 years ago
One space is missing, so the correct version is:
$cmdLine = $path.($gfxConf['strip_all_images'] ? ' -strip ' : ' ').$parameters;
Updated by Steffen Kamper almost 16 years ago
i made a patch.
one small addition: as this is the default behaviour and may be users want to preserve this information it should be possible to switch it off. So i added a check for a setting.
For preserving the profile you need this configuration:
$GLOBALS['TYPO3_CONF_VARS']['GFX']['no_strip'] = true;
look to v2 version of patch.
Updated by Steffen Kamper almost 16 years ago
new patch attached withou any default params. You can add the parameter for stripping profile in Install tool as there are differences between IM and GM, also you may specify the profile to be stripped.
Updated by Oliver Hader over 15 years ago
Added new patch that allows to enable/disable the stripping of profile data specifically by
[IMAGE].file.stripProfile = 0|1 in TypoScript.