Index: trunk/extensions/SocialProfile/UserProfile/SpecialUploadAvatar.php |
— | — | @@ -235,6 +235,8 @@ |
236 | 236 | public $mExtension; |
237 | 237 | |
238 | 238 | function createThumbnail( $imageSrc, $imageInfo, $imgDest, $thumbWidth ) { |
| 239 | + global $wgImageMagickConvertCommand; |
| 240 | + |
239 | 241 | list( $origWidth, $origHeight, $typeCode ) = $imageInfo; |
240 | 242 | |
241 | 243 | if ( $origWidth < $thumbWidth ) { |
— | — | @@ -246,13 +248,28 @@ |
247 | 249 | $border = ' -bordercolor white -border 0x' . ( ( $thumbWidth - $thumbHeight ) / 2 ); |
248 | 250 | } |
249 | 251 | if ( $typeCode == 2 ) { |
250 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . $thumbWidth . '+0+0 -quality 100 ' . $border . ' ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.jpg' ); |
| 252 | + exec( |
| 253 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . $thumbWidth . |
| 254 | + ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . |
| 255 | + $thumbWidth . '+0+0 -quality 100 ' . $border . ' ' . |
| 256 | + $imageSrc . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.jpg' |
| 257 | + ); |
251 | 258 | } |
252 | 259 | if ( $typeCode == 1 ) { |
253 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . $thumbWidth . '+0+0 ' . $imageSrc . ' ' . $border . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.gif' ); |
| 260 | + exec( |
| 261 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . $thumbWidth . |
| 262 | + ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . |
| 263 | + $thumbWidth . '+0+0 ' . $imageSrc . ' ' . $border . ' ' . |
| 264 | + $this->avatarUploadDirectory . '/' . $imgDest . '.gif' |
| 265 | + ); |
254 | 266 | } |
255 | 267 | if ( $typeCode == 3 ) { |
256 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . $thumbWidth . '+0+0 ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.png' ); |
| 268 | + exec( |
| 269 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . $thumbWidth . |
| 270 | + ' -resize ' . $thumbWidth . ' -crop ' . $thumbWidth . 'x' . |
| 271 | + $thumbWidth . '+0+0 ' . $imageSrc . ' ' . |
| 272 | + $this->avatarUploadDirectory . '/' . $imgDest . '.png' |
| 273 | + ); |
257 | 274 | } |
258 | 275 | } |
259 | 276 | |
Index: trunk/extensions/SocialProfile/SystemGifts/SpecialSystemGiftManagerLogo.php |
— | — | @@ -231,6 +231,8 @@ |
232 | 232 | } |
233 | 233 | |
234 | 234 | function createThumbnail( $imageSrc, $ext, $imgDest, $thumbWidth ) { |
| 235 | + global $wgImageMagickConvertCommand; |
| 236 | + |
235 | 237 | list( $origWidth, $origHeight, $typeCode ) = getimagesize( $imageSrc ); |
236 | 238 | |
237 | 239 | if ( $origWidth < $thumbWidth ) { |
— | — | @@ -238,16 +240,29 @@ |
239 | 241 | } |
240 | 242 | $thumbHeight = ( $thumbWidth * $origHeight / $origWidth ); |
241 | 243 | if ( $thumbHeight < $thumbWidth ) { |
242 | | - $border = " -bordercolor white -border 0x" . ( ( $thumbWidth - $thumbHeight ) / 2 ); |
| 244 | + $border = ' -bordercolor white -border 0x' . ( ( $thumbWidth - $thumbHeight ) / 2 ); |
243 | 245 | } |
244 | 246 | if ( $typeCode == 2 ) { |
245 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' -quality 100 ' . $border . ' ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/sg_' . $imgDest . '.jpg' ); |
| 247 | + exec( |
| 248 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 249 | + $thumbWidth . ' -resize ' . $thumbWidth . ' -quality 100 ' . |
| 250 | + $border . ' ' . $imageSrc . ' ' . |
| 251 | + $this->avatarUploadDirectory . '/sg_' . $imgDest . '.jpg' |
| 252 | + ); |
246 | 253 | } |
247 | 254 | if ( $typeCode == 1 ) { |
248 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . $border . ' ' . $this->avatarUploadDirectory . '/sg_' . $imgDest . '.gif' ); |
| 255 | + exec( |
| 256 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 257 | + $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . |
| 258 | + ' ' . $border . ' ' . $this->avatarUploadDirectory . '/sg_' . $imgDest . '.gif' |
| 259 | + ); |
249 | 260 | } |
250 | 261 | if ( $typeCode == 3 ) { |
251 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/sg_' . $imgDest . '.png' ); |
| 262 | + exec( |
| 263 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 264 | + $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . |
| 265 | + ' ' . $this->avatarUploadDirectory . '/sg_' . $imgDest . '.png' |
| 266 | + ); |
252 | 267 | } |
253 | 268 | } |
254 | 269 | |
Index: trunk/extensions/SocialProfile/UserGifts/SpecialGiftManagerLogo.php |
— | — | @@ -238,6 +238,8 @@ |
239 | 239 | } |
240 | 240 | |
241 | 241 | function createThumbnail( $imageSrc, $ext, $imgDest, $thumbWidth ) { |
| 242 | + global $wgImageMagickConvertCommand; |
| 243 | + |
242 | 244 | list( $origWidth, $origHeight, $typeCode ) = getimagesize( $imageSrc ); |
243 | 245 | |
244 | 246 | if ( $origWidth < $thumbWidth ) { |
— | — | @@ -248,13 +250,27 @@ |
249 | 251 | $border = ' -bordercolor white -border 0x' . ( ( $thumbWidth - $thumbHeight ) / 2 ); |
250 | 252 | } |
251 | 253 | if ( $typeCode == 2 ) { |
252 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' -quality 100 ' . $border . ' ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.jpg' ); |
| 254 | + exec( |
| 255 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 256 | + $thumbWidth . ' -resize ' . $thumbWidth . ' -quality 100 ' . |
| 257 | + $border . ' ' . $imageSrc . ' ' . |
| 258 | + $this->avatarUploadDirectory . '/' . $imgDest . '.jpg' |
| 259 | + ); |
253 | 260 | } |
254 | 261 | if ( $typeCode == 1 ) { |
255 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . $border . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.gif' ); |
| 262 | + exec( |
| 263 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 264 | + $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . |
| 265 | + ' ' . $border . ' ' . |
| 266 | + $this->avatarUploadDirectory . '/' . $imgDest . '.gif' |
| 267 | + ); |
256 | 268 | } |
257 | 269 | if ( $typeCode == 3 ) { |
258 | | - exec( 'convert -size ' . $thumbWidth . 'x' . $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . ' ' . $this->avatarUploadDirectory . '/' . $imgDest . ".png" ); |
| 270 | + exec( |
| 271 | + $wgImageMagickConvertCommand . ' -size ' . $thumbWidth . 'x' . |
| 272 | + $thumbWidth . ' -resize ' . $thumbWidth . ' ' . $imageSrc . |
| 273 | + ' ' . $this->avatarUploadDirectory . '/' . $imgDest . '.png' |
| 274 | + ); |
259 | 275 | } |
260 | 276 | } |
261 | 277 | |