Project

General

Profile

Actions

Feature #19748

closed

ImageMagick generates larger than necessary files

Added by John Angel almost 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2008-12-27
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

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

10025_v8.patch (5.48 KB) 10025_v8.patch Administrator Admin, 2009-03-27 17:28
Actions #1

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.

Actions #2

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;

Actions #3

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;

Actions #4

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.

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Steffen Kamper over 15 years ago

committed v8 to trunk, rev 5233

Actions

Also available in: Atom PDF