@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | // {{{ requires |
19 | 19 | |
20 | 20 | //require_once __DIR__ . '/Image/Transform.php'; |
21 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Transform.php'; |
|
21 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Transform.php'; |
|
22 | 22 | |
23 | 23 | // }}} |
24 | 24 | // {{{ example usage |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $this->image = $image; |
100 | 100 | $this->imageHandle = imlib_load_image($this->image); |
101 | - $result =& $this->_get_image_details($image); |
|
101 | + $result = & $this->_get_image_details($image); |
|
102 | 102 | if (PEAR::isError($result)) { |
103 | 103 | return $result; |
104 | 104 | } |
@@ -139,19 +139,19 @@ discard block |
||
139 | 139 | 'size' => '12', |
140 | 140 | 'angle' => IMLIB_TEXT_TO_RIGHT, |
141 | 141 | ]; |
142 | - $params = array_merge($default_params, $params); |
|
142 | + $params = array_merge($default_params, $params); |
|
143 | 143 | extract($params); |
144 | 144 | |
145 | 145 | if (!is_array($color)) { |
146 | 146 | if ('#' == $color[0]) { |
147 | 147 | $color = $this->colorhex2colorarray($color); |
148 | 148 | } else { |
149 | - require_once __DIR__ . '/Image/Transform/Driver/ColorsDefs.php'; |
|
149 | + require_once __DIR__.'/Image/Transform/Driver/ColorsDefs.php'; |
|
150 | 150 | $color = isset($colornames[$color]) ? $colornames[$color] : false; |
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - $fontResource = imlib_load_font($font . '/' . $size); |
|
154 | + $fontResource = imlib_load_font($font.'/'.$size); |
|
155 | 155 | imlib_text_draw($this->imageHandle, $fontResource, $x, $y, $text, $angle, $color[0], $color[1], $color[2], 255); |
156 | 156 | |
157 | 157 | return true; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $this->imageHandle = $this->oldHandle; |
251 | 251 | $this->resized = false; |
252 | 252 | if (!$return) { |
253 | - return PEAR::raiseError('Couldn\'t save image. Reason: ' . $err, true); |
|
253 | + return PEAR::raiseError('Couldn\'t save image. Reason: '.$err, true); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | return true; |
@@ -279,13 +279,13 @@ discard block |
||
279 | 279 | $quality = (null === $quality) ? $this->_options['quality'] : $quality; |
280 | 280 | imlib_image_set_format($this->imageHandle, $type); |
281 | 281 | $err = 0; |
282 | - header('Content-type: ' . $this->getMimeType($type)); |
|
282 | + header('Content-type: '.$this->getMimeType($type)); |
|
283 | 283 | $return = imlib_dump_image($this->imageHandle, $err, $quality); |
284 | 284 | $this->imageHandle = $this->oldHandle; |
285 | 285 | $this->resized = false; |
286 | 286 | imlib_free_image($this->oldHandle); |
287 | 287 | if (!$return) { |
288 | - return PEAR::raiseError('Couldn\'t output image. Reason: ' . $err, true); |
|
288 | + return PEAR::raiseError('Couldn\'t output image. Reason: '.$err, true); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | return true; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | 'pcl' => 'w', |
61 | 61 | 'pcx' => 'rw', |
62 | 62 | 'pdb' => 'rw', |
63 | - 'pdf' => 'w', // Requires Ghostscript to read |
|
63 | + 'pdf' => 'w', // Requires Ghostscript to read |
|
64 | 64 | 'pfa' => 'r', |
65 | 65 | 'pfb' => 'r', |
66 | 66 | 'pgm' => 'rw', |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @link http://pear.php.net/package/Image_Transform |
24 | 24 | */ |
25 | 25 | |
26 | -require_once __DIR__ . '/Image/Transform.php'; |
|
26 | +require_once __DIR__.'/Image/Transform.php'; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * imagick PECL extension implementation for Image_Transform package |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function __construct() |
73 | 73 | { |
74 | 74 | if (PEAR::loadExtension('imagick')) { |
75 | - include __DIR__ . '/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
75 | + include __DIR__.'/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
76 | 76 | } else { |
77 | 77 | $this->isError(PEAR::raiseError('Could not find the imagick extension.', IMAGE_TRANSFORM_ERROR_UNSUPPORTED)); |
78 | 78 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } catch (ImagickException $e) { |
97 | 97 | $this->free(); |
98 | 98 | |
99 | - return $this->raiseError('Could not load image:' . $e->getMessage(), IMAGE_TRANSFORM_ERROR_IO); |
|
99 | + return $this->raiseError('Could not load image:'.$e->getMessage(), IMAGE_TRANSFORM_ERROR_IO); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $this->image = $image; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | try { |
163 | 163 | $this->imagick->rotateImage($pixel, $angle); |
164 | 164 | } catch (ImagickException $e) { |
165 | - return $this->raiseError('Cannot create a new imagick image for the rotation: ' . $e->getMessage(), IMAGE_TRANSFORM_ERROR_FAILED); |
|
165 | + return $this->raiseError('Cannot create a new imagick image for the rotation: '.$e->getMessage(), IMAGE_TRANSFORM_ERROR_FAILED); |
|
166 | 166 | } |
167 | 167 | $info = $this->imagick->getImageGeometry(); |
168 | 168 | $this->new_x = $info['width']; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | try { |
248 | 248 | $this->imagick->writeImage($filename); |
249 | 249 | } catch (ImagickException $e) { |
250 | - return $this->raiseError('Could not save image to file: ' . $e->getMessage(), IMAGE_TRANSFORM_ERROR_IO); |
|
250 | + return $this->raiseError('Could not save image to file: '.$e->getMessage(), IMAGE_TRANSFORM_ERROR_IO); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | if (!$this->keep_settings_on_save) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | } catch (ImagickException $e) { |
290 | 290 | return $this->raiseError('Could not display image.', IMAGE_TRANSFORM_ERROR_IO); |
291 | 291 | } |
292 | - header('Content-type: ' . $this->getMimeType($type)); |
|
292 | + header('Content-type: '.$this->getMimeType($type)); |
|
293 | 293 | echo $image; |
294 | 294 | $this->free(); |
295 | 295 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | //require_once __DIR__ . '/Image/Transform.php'; |
29 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Image/Transform.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Image/Transform.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * imagick PECL extension implementation for Image_Transform package |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function __construct() |
76 | 76 | { |
77 | 77 | if (PEAR::loadExtension('imagick')) { |
78 | - include __DIR__ . '/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
78 | + include __DIR__.'/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
79 | 79 | } else { |
80 | 80 | $this->isError(PEAR::raiseError('Couldn\'t find the imagick extension.', IMAGE_TRANSFORM_ERROR_UNSUPPORTED)); |
81 | 81 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | imagick_begindraw($this->imageHandle); |
192 | 192 | |
193 | 193 | foreach ($cmds as $cmd => $v) { |
194 | - if (!call_user_func('imagick_' . $cmd, $this->imageHandle, $params[$v])) { |
|
194 | + if (!call_user_func('imagick_'.$cmd, $this->imageHandle, $params[$v])) { |
|
195 | 195 | return $this->raiseError("Problem with adding Text::{$v} = {$params[$v]}", IMAGE_TRANSFORM_ERROR_FAILED); |
196 | 196 | } |
197 | 197 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | if (!($image = imagick_image2blob($this->imageHandle))) { |
264 | 264 | return $this->raiseError('Couldn\'t display image.', IMAGE_TRANSFORM_ERROR_IO); |
265 | 265 | } |
266 | - header('Content-type: ' . imagick_getmimetype($this->imageHandle)); |
|
266 | + header('Content-type: '.imagick_getmimetype($this->imageHandle)); |
|
267 | 267 | echo $image; |
268 | 268 | $this->free(); |
269 | 269 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | public function raiseError($message, $code = 0) |
370 | 370 | { |
371 | 371 | if (is_resource($this->imageHandle)) { |
372 | - $message .= "\nReason: " . imagick_failedreason($this->imageHandle) . "\nDescription: " . imagick_faileddescription($this->imageHandle); |
|
372 | + $message .= "\nReason: ".imagick_failedreason($this->imageHandle)."\nDescription: ".imagick_faileddescription($this->imageHandle); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return PEAR::raiseError($message, $code); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * Include of base class |
27 | 27 | */ |
28 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Image/Transform.php'; |
|
28 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Image/Transform.php'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Image Transformation interface using old ImageMagick extension |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if (!PEAR::loadExtension('imagick')) { |
60 | 60 | return PEAR::raiseError('The imagick extension can not be found.', true); |
61 | 61 | } |
62 | - include __DIR__ . '/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
62 | + include __DIR__.'/Image/Transform/Driver/Imagick/ImageTypes.php'; |
|
63 | 63 | |
64 | 64 | //return true; |
65 | 65 | } // End Image_IM |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | if (!imagick_read($this->imageHandle, $image)) { |
83 | - return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true); |
|
83 | + return PEAR::raiseError('The image file '.$image.' does\'t exist', true); |
|
84 | 84 | } |
85 | 85 | $this->image = $image; |
86 | 86 | $result = $this->_get_image_details($image); |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | 'font' => 'Arial.ttf', |
162 | 162 | 'resize_first' => false // Carry out the scaling of the image before annotation? |
163 | 163 | ]; |
164 | - $params = array_merge($default_params, $params); |
|
164 | + $params = array_merge($default_params, $params); |
|
165 | 165 | extract($params); |
166 | 166 | |
167 | 167 | $color = is_array($color) ? $this->colorarray2colorhex($color) : strtolower($color); |
168 | 168 | |
169 | 169 | imagick_annotate($this->imageHandle, [ |
170 | - 'primitive' => "text $x,$y " . $text, |
|
170 | + 'primitive' => "text $x,$y ".$text, |
|
171 | 171 | 'pointsize' => $size, |
172 | 172 | 'antialias' => 0, |
173 | 173 | 'fill' => $color, |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | public function display($type = '', $quality = 75) |
207 | 207 | { |
208 | 208 | if ('' == $type) { |
209 | - header('Content-type: image/' . $this->type); |
|
209 | + header('Content-type: image/'.$this->type); |
|
210 | 210 | if (!imagick_dump($this->imageHandle)) { |
211 | 211 | } |
212 | 212 | } else { |
213 | - header('Content-type: image/' . $type); |
|
213 | + header('Content-type: image/'.$type); |
|
214 | 214 | if (!imagick_dump($this->imageHandle, $this->type)) { |
215 | 215 | } |
216 | 216 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | //require_once __DIR__ . '/Image/Transform.php'; |
27 | 27 | //require_once __DIR__ . '/System.php'; |
28 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Transform.php'; |
|
29 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/System.php'; |
|
28 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Transform.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/System.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * NetPBM implementation for Image_Transform package |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | public function __construct() |
65 | 65 | { |
66 | 66 | if (!defined('IMAGE_TRANSFORM_NETPBM_PATH')) { |
67 | - $path = dirname(System::which('pnmscale')) . DIRECTORY_SEPARATOR; |
|
67 | + $path = dirname(System::which('pnmscale')).DIRECTORY_SEPARATOR; |
|
68 | 68 | define('IMAGE_TRANSFORM_NETPBM_PATH', $path); |
69 | 69 | } |
70 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmscale' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
70 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmscale'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
71 | 71 | $this->isError(PEAR::raiseError('Couldn\'t find "pnmscale" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED)); |
72 | 72 | } |
73 | 73 | } // End function Image_NetPBM |
@@ -113,24 +113,24 @@ discard block |
||
113 | 113 | if ($scale_x == $new_y / $this->img_x |
114 | 114 | && $scale_x > 1 |
115 | 115 | && floor($scale_x) == $scale_x) { |
116 | - if (System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmenlarge' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
116 | + if (System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmenlarge'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
117 | 117 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmenlarge', $scale_x); |
118 | 118 | } else { |
119 | 119 | return PEAR::raiseError('Couldn\'t find "pnmenlarge" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
120 | 120 | } |
121 | 121 | } else { |
122 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-nomix -width ' . ((int)$new_x) . ' -height ' . ((int)$new_y)); |
|
122 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-nomix -width '.((int)$new_x).' -height '.((int)$new_y)); |
|
123 | 123 | } |
124 | 124 | break; |
125 | 125 | |
126 | 126 | case 'smooth': |
127 | 127 | default: |
128 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-width ' . ((int)$new_x) . ' -height ' . ((int)$new_y)); |
|
128 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-width '.((int)$new_x).' -height '.((int)$new_y)); |
|
129 | 129 | // Smooth things if scaling by a factor more than 3 |
130 | 130 | // (see pnmscale man page) |
131 | 131 | if ($new_x / $this->img_x > 3 |
132 | 132 | || $new_y / $this->img_y > 3) { |
133 | - if (System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmsmooth' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
133 | + if (System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmsmooth'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
134 | 134 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmsmooth'); |
135 | 135 | } else { |
136 | 136 | return PEAR::raiseError('Couldn\'t find "pnmsmooth" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | // even if acceptable range is -90 to +90 (see pnmrotate man page) |
163 | 163 | // Bring image to that range by using pamflip |
164 | 164 | if ($angle > 45 && $angle < 315) { |
165 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
165 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pamflip'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
166 | 166 | return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
167 | 167 | } |
168 | 168 | |
169 | 169 | $quarters = floor(ceil($angle / 45) / 2); |
170 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pamflip', '-rotate' . (360 - $quarters * 90)); |
|
171 | - $angle -= $quarters * 90; |
|
170 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pamflip', '-rotate'.(360 - $quarters * 90)); |
|
171 | + $angle -= $quarters * 90; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | if (0 != $angle) { |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $angle -= 360; |
177 | 177 | } |
178 | 178 | |
179 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmrotate' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
179 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmrotate'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
180 | 180 | return PEAR::raiseError('Couldn\'t find "pnmrotate" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
181 | 181 | } |
182 | 182 | |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | |
186 | 186 | $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth'); |
187 | 187 | if ('pixel' != $scaleMethod) { |
188 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background=' . $bgcolor . ' -' . (float)$angle); |
|
188 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background='.$bgcolor.' -'.(float)$angle); |
|
189 | 189 | } else { |
190 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background=' . $bgcolor . ' -noantialias -' . (float)$angle); |
|
190 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background='.$bgcolor.' -noantialias -'.(float)$angle); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | if (0 != $x || 0 != $y |
215 | 215 | || $width != $this->img_x |
216 | 216 | || $height != $this->img_y) { |
217 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmcut' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
217 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmcut'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
218 | 218 | return PEAR::raiseError('Couldn\'t find "pnmcut" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
219 | 219 | } |
220 | 220 | |
221 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmcut', '-left ' . ((int)$x) . ' -top ' . ((int)$y) . ' -width ' . ((int)$width) . ' -height ' . ((int)$height)); |
|
221 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmcut', '-left '.((int)$x).' -top '.((int)$y).' -width '.((int)$width).' -height '.((int)$height)); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | return true; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public function gamma($outputgamma = 1.0) |
235 | 235 | { |
236 | 236 | if (1.0 != $outputgamme) { |
237 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmgamma' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
237 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pnmgamma'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
238 | 238 | return PEAR::raiseError('Couldn\'t find "pnmgamma" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
239 | 239 | } |
240 | 240 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmgamma', (float)$outputgamma); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | **/ |
252 | 252 | public function flip() |
253 | 253 | { |
254 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
254 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pamflip'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
255 | 255 | return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
256 | 256 | } |
257 | 257 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pamflip', '-topbottom'); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | **/ |
268 | 268 | public function mirror() |
269 | 269 | { |
270 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
270 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'pamflip'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
271 | 271 | return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
272 | 272 | } |
273 | 273 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pamflip', '-leftright'); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | **/ |
284 | 284 | public function greyscale() |
285 | 285 | { |
286 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmtopgm' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
286 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'ppmtopgm'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
287 | 287 | return PEAR::raiseError('Couldn\'t find "ppmtopgm" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
288 | 288 | } |
289 | 289 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmtopgm'); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function addText($params) |
312 | 312 | { |
313 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmlabel' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
313 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'ppmlabel'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
314 | 314 | return PEAR::raiseError('Couldn\'t find "ppmlabel" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
315 | 315 | } |
316 | 316 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $color = $this->_getColor('colorFont', $options, [0, 0, 0]); |
323 | 323 | $color = $this->colorarray2colorhex($color); |
324 | 324 | |
325 | - $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . ((int)($y + $size)) . ' -text ' . escapeshellarg($text)); |
|
325 | + $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle '.((int)$angle).' -colour '.escapeshellarg($color).' -size '.((float)$size).' -x '.((int)$x).' -y '.((int)($y + $size)).' -text '.escapeshellarg($text)); |
|
326 | 326 | } // End addText |
327 | 327 | |
328 | 328 | /** |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function _postProcess($type, $quality) |
337 | 337 | { |
338 | - array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, strtolower($this->type) . 'topnm', escapeshellarg($this->image))); |
|
338 | + array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, strtolower($this->type).'topnm', escapeshellarg($this->image))); |
|
339 | 339 | $arg = ''; |
340 | 340 | $type = strtolower($type); |
341 | 341 | $program = ''; |
342 | 342 | switch ($type) { |
343 | 343 | // ppmto* converters |
344 | 344 | case 'gif': |
345 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmquant' . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
345 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.'ppmquant'.((OS_WINDOWS) ? '.exe' : ''))) { |
|
346 | 346 | return PEAR::raiseError('Couldn\'t find "ppmquant" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
347 | 347 | } |
348 | 348 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmquant', 256); |
@@ -367,14 +367,14 @@ discard block |
||
367 | 367 | case 'uil': |
368 | 368 | case 'xpm': |
369 | 369 | case 'yuv': |
370 | - $program = 'ppmto' . $type; |
|
370 | + $program = 'ppmto'.$type; |
|
371 | 371 | break; |
372 | 372 | |
373 | 373 | // Windows icon |
374 | 374 | case 'winicon': |
375 | 375 | case 'ico': |
376 | 376 | $type = 'winicon'; |
377 | - $program = 'ppmto' . $type; |
|
377 | + $program = 'ppmto'.$type; |
|
378 | 378 | break; |
379 | 379 | |
380 | 380 | // pbmto* converters |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | case 'ybm': |
408 | 408 | case 'zinc': |
409 | 409 | case '10x': |
410 | - $program = 'pbmto' . $type; |
|
410 | + $program = 'pbmto'.$type; |
|
411 | 411 | break; |
412 | 412 | |
413 | 413 | // pamto* converters |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | case 'html': |
418 | 418 | case 'pfm': |
419 | 419 | case 'tga': |
420 | - $program = 'pamto' . $type; |
|
420 | + $program = 'pamto'.$type; |
|
421 | 421 | break; |
422 | 422 | |
423 | 423 | // pnmto* converters |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | $type = 'jpeg'; |
432 | 432 | // no break |
433 | 433 | case 'jpeg': |
434 | - $arg = '--quality=' . $quality; |
|
434 | + $arg = '--quality='.$quality; |
|
435 | 435 | // no break |
436 | 436 | case 'jbig': |
437 | 437 | case 'fits': |
@@ -445,16 +445,16 @@ discard block |
||
445 | 445 | case 'sir': |
446 | 446 | case 'tiff': |
447 | 447 | case 'xwd': |
448 | - $program = 'pnmto' . $type; |
|
448 | + $program = 'pnmto'.$type; |
|
449 | 449 | break; |
450 | 450 | |
451 | 451 | } // switch |
452 | 452 | |
453 | 453 | if ('' == $program) { |
454 | - $program = 'pnmto' . $type; |
|
454 | + $program = 'pnmto'.$type; |
|
455 | 455 | } |
456 | 456 | |
457 | - if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . $program . ((OS_WINDOWS) ? '.exe' : ''))) { |
|
457 | + if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH.$program.((OS_WINDOWS) ? '.exe' : ''))) { |
|
458 | 458 | return PEAR::raiseError("Couldn't find \"$program\" binary", IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
459 | 459 | } |
460 | 460 | $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, $program); |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | |
482 | 482 | $nullDevice = (OS_WINDOWS) ? 'nul' : '/dev/null'; |
483 | 483 | |
484 | - $cmd = $this->_postProcess($type, $quality) . '> "' . $filename . '"'; |
|
485 | - exec($cmd . ' 2> ' . $nullDevice, $res, $exit); |
|
484 | + $cmd = $this->_postProcess($type, $quality).'> "'.$filename.'"'; |
|
485 | + exec($cmd.' 2> '.$nullDevice, $res, $exit); |
|
486 | 486 | if (!$this->keep_settings_on_save) { |
487 | 487 | $this->free(); |
488 | 488 | } |
@@ -506,9 +506,9 @@ discard block |
||
506 | 506 | } |
507 | 507 | $quality = $this->_getOption('quality', $options, 75); |
508 | 508 | |
509 | - header('Content-type: ' . $this->getMimeType($type)); |
|
509 | + header('Content-type: '.$this->getMimeType($type)); |
|
510 | 510 | $cmd = $this->_postProcess($type, $quality); |
511 | - passthru($cmd . ' 2>&1'); |
|
511 | + passthru($cmd.' 2>&1'); |
|
512 | 512 | if (!$this->keep_settings_on_save) { |
513 | 513 | $this->free(); |
514 | 514 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | //require_once __DIR__ . '/Image/Transform.php'; |
29 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/Image/Transform.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/Image/Transform.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * GD implementation for Image_Transform package |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | return PEAR::raiseError('Image type not supported for input', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
141 | 141 | } |
142 | 142 | |
143 | - $functionName = 'ImageCreateFrom' . $this->type; |
|
143 | + $functionName = 'ImageCreateFrom'.$this->type; |
|
144 | 144 | $this->imageHandle = $functionName($this->image); |
145 | 145 | if (!$this->imageHandle) { |
146 | 146 | $this->imageHandle = null; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @author Peter Bowyer |
173 | 173 | * @access public |
174 | 174 | */ |
175 | - public function addBorder($border_width=null, $color = '') |
|
175 | + public function addBorder($border_width = null, $color = '') |
|
176 | 176 | { |
177 | 177 | $this->new_x = $this->img_x + 2 * $border_width; |
178 | 178 | $this->new_y = $this->img_y + 2 * $border_width; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @return bool|PEAR_Error TRUE or a PEAR_Error object on error |
215 | 215 | */ |
216 | - public function addText($params=null) |
|
216 | + public function addText($params = null) |
|
217 | 217 | { |
218 | 218 | $this->oldImage = $this->imageHandle; |
219 | 219 | $params = array_merge($this->_get_default_text_params(), $params); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @return bool|PEAR_Error TRUE on success or PEAR_Error object on error |
384 | 384 | * @access protected |
385 | 385 | */ |
386 | - public function _resize($new_x=null, $new_y=null, $options = null) |
|
386 | + public function _resize($new_x = null, $new_y = null, $options = null) |
|
387 | 387 | { |
388 | 388 | if (true === $this->resized) { |
389 | 389 | return PEAR::raiseError('You have already resized the image without saving it. Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE); |
@@ -464,13 +464,13 @@ discard block |
||
464 | 464 | } |
465 | 465 | |
466 | 466 | if ('' == $filename) { |
467 | - header('Content-type: ' . $this->getMimeType($type)); |
|
467 | + header('Content-type: '.$this->getMimeType($type)); |
|
468 | 468 | $action = 'output image'; |
469 | 469 | } else { |
470 | 470 | $action = 'save image to file'; |
471 | 471 | } |
472 | 472 | |
473 | - $functionName = 'image' . $type; |
|
473 | + $functionName = 'image'.$type; |
|
474 | 474 | switch ($type) { |
475 | 475 | case 'jpeg': |
476 | 476 | $result = $functionName($this->imageHandle, $filename, $quality); |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | } |
484 | 484 | } |
485 | 485 | if (!$result) { |
486 | - return PEAR::raiseError('Couldn\'t ' . $action, IMAGE_TRANSFORM_ERROR_IO); |
|
486 | + return PEAR::raiseError('Couldn\'t '.$action, IMAGE_TRANSFORM_ERROR_IO); |
|
487 | 487 | } |
488 | 488 | $this->imageHandle = $this->oldImage; |
489 | 489 | if (!$this->keep_settings_on_save) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * Include for error handling |
31 | 31 | */ |
32 | 32 | //require_once __DIR__ . '/PEAR.php'; |
33 | -require_once XOOPS_ROOT_PATH . '/modules/extgallery/class/pear/PEAR.php'; |
|
33 | +require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/pear/PEAR.php'; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Error code for unsupported library, image format or methods |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | } |
220 | 220 | } |
221 | 221 | if (!$driver) { |
222 | - return PEAR::raiseError('No image library specified and none can be found.' . ' You must specify driver in factory() call.', IMAGE_TRANSFORM_ERROR_ARGUMENT); |
|
222 | + return PEAR::raiseError('No image library specified and none can be found.'.' You must specify driver in factory() call.', IMAGE_TRANSFORM_ERROR_ARGUMENT); |
|
223 | 223 | } |
224 | 224 | } else { |
225 | 225 | switch (strtolower($driver)) { |
@@ -239,25 +239,25 @@ discard block |
||
239 | 239 | } |
240 | 240 | |
241 | 241 | // $file = 'Image/Transform/Driver/' . $driver . '.php'; |
242 | - $file = __DIR__ . '/Transform/Driver/' . $driver . '.php'; |
|
242 | + $file = __DIR__.'/Transform/Driver/'.$driver.'.php'; |
|
243 | 243 | if (!@fclose(@fopen($file, 'r', true))) { |
244 | - return PEAR::raiseError('Driver failed to load file ' . $file, IMAGE_TRANSFORM_DRIVER_FILE_MISSING); |
|
244 | + return PEAR::raiseError('Driver failed to load file '.$file, IMAGE_TRANSFORM_DRIVER_FILE_MISSING); |
|
245 | 245 | } |
246 | 246 | |
247 | - $classname = 'Image_Transform_Driver_' . $driver; |
|
247 | + $classname = 'Image_Transform_Driver_'.$driver; |
|
248 | 248 | |
249 | 249 | if (!class_exists($classname)) { |
250 | 250 | require_once $file; |
251 | 251 | |
252 | 252 | if (!class_exists($classname)) { |
253 | - return PEAR::raiseError('Image library ' . $driver . ' not supported... aborting.', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
|
253 | + return PEAR::raiseError('Image library '.$driver.' not supported... aborting.', IMAGE_TRANSFORM_ERROR_UNSUPPORTED); |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | $obj = new $classname(); |
257 | 257 | |
258 | 258 | // Check startup error |
259 | - if ($error =& $obj->isError()) { |
|
260 | - $obj =& $error; |
|
259 | + if ($error = & $obj->isError()) { |
|
260 | + $obj = & $error; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | return $obj; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | public function &isError($error = null) |
275 | 275 | { |
276 | 276 | if (null !== $error) { |
277 | - $this->_error =& $error; |
|
277 | + $this->_error = & $error; |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | return $this->_error; |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | $this->img_x, |
913 | 913 | $this->img_y, |
914 | 914 | $this->_convert_image_type($this->type), |
915 | - 'height="' . $this->img_y . '" width="' . $this->img_x . '"', |
|
915 | + 'height="'.$this->img_y.'" width="'.$this->img_x.'"', |
|
916 | 916 | 'mime' => $this->getMimeType() |
917 | 917 | ]; |
918 | 918 | } |
@@ -952,10 +952,10 @@ discard block |
||
952 | 952 | { |
953 | 953 | if (!OS_WINDOWS |
954 | 954 | || !preg_match('/\s/', $path)) { |
955 | - return $path . $command . ' ' . $args; |
|
955 | + return $path.$command.' '.$args; |
|
956 | 956 | } |
957 | 957 | |
958 | - return 'start /D "' . $path . '" /B ' . $command . ' ' . $args; |
|
958 | + return 'start /D "'.$path.'" /B '.$command.' '.$args; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | /** |
@@ -1086,8 +1086,8 @@ discard block |
||
1086 | 1086 | // Find the filename of the original image: |
1087 | 1087 | $filename = explode('.', basename($this->image)); |
1088 | 1088 | $filename = $filename[0]; |
1089 | - header('Content-type: ' . $this->getMimeType($type)); |
|
1090 | - header('Content-Disposition: inline; filename=' . $filename . '.' . $type); |
|
1089 | + header('Content-type: '.$this->getMimeType($type)); |
|
1090 | + header('Content-Disposition: inline; filename='.$filename.'.'.$type); |
|
1091 | 1091 | } |
1092 | 1092 | |
1093 | 1093 | /** |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | */ |
1123 | 1123 | public function getTempDir() |
1124 | 1124 | { |
1125 | - require_once __DIR__ . '/System.php'; |
|
1125 | + require_once __DIR__.'/System.php'; |
|
1126 | 1126 | |
1127 | 1127 | return System::tmpdir(); |
1128 | 1128 | } |
@@ -1138,7 +1138,7 @@ discard block |
||
1138 | 1138 | public function getTempFile($dirname = null) |
1139 | 1139 | { |
1140 | 1140 | if (null === $dirname) { |
1141 | - require_once __DIR__ . '/System.php'; |
|
1141 | + require_once __DIR__.'/System.php'; |
|
1142 | 1142 | $dirname = System::tmpdir(); |
1143 | 1143 | } |
1144 | 1144 | |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | return $this->colorhex2colorarray($color); |
1287 | 1287 | } |
1288 | 1288 | static $colornames = []; |
1289 | - require_once __DIR__ . '/Image/Transform/Driver/ColorsDefs.php'; |
|
1289 | + require_once __DIR__.'/Image/Transform/Driver/ColorsDefs.php'; |
|
1290 | 1290 | |
1291 | 1291 | return (isset($colornames[$color])) ? $colornames[$color] : $default; |
1292 | 1292 | } |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * base class |
18 | 18 | */ |
19 | -require_once __DIR__ . '/PEAR.php'; |
|
20 | -require_once __DIR__ . '/Console/Getopt.php'; |
|
19 | +require_once __DIR__.'/PEAR.php'; |
|
20 | +require_once __DIR__.'/Console/Getopt.php'; |
|
21 | 21 | |
22 | 22 | $GLOBALS['_System_temp_files'] = []; |
23 | 23 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if (empty($a)) { |
93 | 93 | continue; |
94 | 94 | } |
95 | - $argv[$k] = trim($a) ; |
|
95 | + $argv[$k] = trim($a); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | natsort($list); |
161 | 161 | if ($aktinst < $maxinst || 0 == $maxinst) { |
162 | 162 | foreach ($list as $val) { |
163 | - $path = $sPath . DIRECTORY_SEPARATOR . $val; |
|
163 | + $path = $sPath.DIRECTORY_SEPARATOR.$val; |
|
164 | 164 | if (is_dir($path) && !is_link($path)) { |
165 | 165 | $tmp = self::_dirToStruct($path, $maxinst, $aktinst + 1, $silent); |
166 | 166 | $struct = array_merge_recursive($struct, $tmp); |
@@ -332,11 +332,11 @@ discard block |
||
332 | 332 | for ($i = 0; $i < $count_args; $i++) { |
333 | 333 | if ('>' == $args[$i]) { |
334 | 334 | $mode = 'wb'; |
335 | - $outputfile = $args[$i+1]; |
|
335 | + $outputfile = $args[$i + 1]; |
|
336 | 336 | break; |
337 | 337 | } elseif ('>>' == $args[$i]) { |
338 | 338 | $mode = 'ab+'; |
339 | - $outputfile = $args[$i+1]; |
|
339 | + $outputfile = $args[$i + 1]; |
|
340 | 340 | break; |
341 | 341 | } else { |
342 | 342 | $files[] = $args[$i]; |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) { |
476 | 476 | return $var; |
477 | 477 | } |
478 | - return getenv('SystemRoot') . '\temp'; |
|
478 | + return getenv('SystemRoot').'\temp'; |
|
479 | 479 | } |
480 | 480 | if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) { |
481 | 481 | return $var; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | |
527 | 527 | foreach ($exe_suffixes as $suff) { |
528 | 528 | foreach ($path_elements as $dir) { |
529 | - $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; |
|
529 | + $file = $dir.DIRECTORY_SEPARATOR.$program.$suff; |
|
530 | 530 | if (is_executable($file)) { |
531 | 531 | return $file; |
532 | 532 | } |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | for ($i = 0; $i < $args_count; $i++) { |
574 | 574 | switch ($args[$i]) { |
575 | 575 | case '-type': |
576 | - if (in_array($args[$i+1], ['d', 'f'])) { |
|
576 | + if (in_array($args[$i + 1], ['d', 'f'])) { |
|
577 | 577 | if ('d' == $args[$i + 1]) { |
578 | 578 | $do_files = false; |
579 | 579 | } else { |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $i++; |
584 | 584 | break; |
585 | 585 | case '-name': |
586 | - $name = preg_quote($args[$i+1], '#'); |
|
586 | + $name = preg_quote($args[$i + 1], '#'); |
|
587 | 587 | // our magic characters ? and * have just been escaped, |
588 | 588 | // so now we change the escaped versions to PCRE operators |
589 | 589 | $name = strtr($name, ['\?' => '.', '\*' => '.*']); |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $i++; |
592 | 592 | break; |
593 | 593 | case '-maxdepth': |
594 | - $depth = $args[$i+1]; |
|
594 | + $depth = $args[$i + 1]; |
|
595 | 595 | break; |
596 | 596 | } |
597 | 597 | } |