-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
122 lines (111 loc) · 4.52 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
// Disable image processing before check if PHP extension Imagick is loaded.
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_enabled'] = 0;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] = 0;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] = 0;
if (version_compare(TYPO3_version, '8.0', '<')) { // some compat with older versions
$GLOBALS['TYPO3_CONF_VARS']['GFX']['image_processing'] = 0;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] = 0;
}
if (extension_loaded('imagick')) {
// Xclass
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Imaging\\GraphicalFunctions'] = array(
'className' => 'ImagickImgTeam\\Imagickimg\\Xclass\\GraphicalFunctions'
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder'] = array(
'className' => 'ImagickImgTeam\\Imagickimg\\Xclass\\GifBuilder'
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Resource\\OnlineMedia\\Processing\\PreviewProcessing'] = array(
'className' => 'ImagickImgTeam\\Imagickimg\\Xclass\\PreviewProcessing'
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Resource\\Processing\\LocalPreviewHelper'] = array(
'className' => 'ImagickImgTeam\\Imagickimg\\Xclass\\LocalPreviewHelper'
);
// Imagick loaded, so turn on image processing
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_enabled'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'] = ''; // Not necesary while using Imagick
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path_lzw'] = ''; // Not necesary while using Imagick
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_effects'] = 1;
if (version_compare(TYPO3_version, '8.0', '<')) { // some compat with older versions
$GLOBALS['TYPO3_CONF_VARS']['GFX']['image_processing'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'] = ''; // Not necesary while using Imagick
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] = ''; // Not necesary while using Imagick
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_v5effects'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileByDefault'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_useStripProfileByDefault'];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_stripProfileCommand'];
}
$GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['gif_compress'] = 0; // Don't use TYPO3 work around. Imagick will compress the images.
// unserializing the extension configuration
$_EXTCONF = unserialize($_EXTCONF);
switch($_EXTCONF['windowingFilter']) {
case 'POINT':
$wF = \Imagick::FILTER_POINT;
break;
case 'BOX':
$wF = \Imagick::FILTER_BOX;
break;
case 'TRIANGLE':
$wF = \Imagick::FILTER_TRIANGLE;
break;
case 'HERMITE':
$wF = \Imagick::FILTER_HERMITE;
break;
case 'HANNING':
$wF = \Imagick::FILTER_HANNING;
break;
case 'HAMMING':
$wF = \Imagick::FILTER_HAMMING;
break;
case 'BLACKMAN':
$wF = \Imagick::FILTER_BLACKMAN;
break;
case 'GAUSSIAN':
$wF = \Imagick::FILTER_GAUSSIAN;
break;
case 'QUADRATIC':
$wF = \Imagick::FILTER_QUADRIC;
break;
case 'CUBIC':
$wF = \Imagick::FILTER_CUBIC;
break;
case 'CATROM':
$wF = \Imagick::FILTER_CATROM;
break;
case 'MITCHELL':
$wF = \Imagick::FILTER_MITCHELL;
break;
case 'LANCZOS':
$wF = \Imagick::FILTER_LANCZOS;
break;
case 'BESSEL':
$wF = \Imagick::FILTER_BESSEL;
break;
case 'SINC':
$wF = \Imagick::FILTER_SINC;
break;
default:
$wF = \Imagick::FILTER_CATROM;
}
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagick'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['windowing_filter'] = $wF;
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagesDPI'] = $_EXTCONF['imagesDPI'];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnailingMethod'] = $_EXTCONF['thumbnailingMethod'];
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagick_debug'] = $_EXTCONF['debug'];
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagick_debug']) {
$GLOBALS['TYPO3_CONF_VARS']['LOG']['ImagickImgTeam']['Imagickimg']['writerConfiguration'] = array(
// configuration for WARNING severity, including all
// levels with higher severity (ERROR, CRITICAL, EMERGENCY)
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => array(
// add a FileWriter
'TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array(
// configuration for the writer
'logFile' => 'typo3temp/var/logs/imagickimg.log'
)
)
);
}
}