Page MenuHomePhabricator

ThumbnailPatch3.diff

Authored By
bzimport
Nov 21 2014, 6:45 PM
Size
1 KB
Referenced Files
None
Subscribers
None

ThumbnailPatch3.diff

Index: includes/Image.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Image.php,v
retrieving revision 1.19
diff -u -r1.19 Image.php
--- includes/Image.php 24 Aug 2004 08:11:45 -0000 1.19
+++ includes/Image.php 28 Aug 2004 02:22:09 -0000
@@ -200,14 +200,24 @@
break;
}
$height = floor( $this->height * ( $width/$this->width ) );
- if ( $truecolor ) {
+ if( $truecolor ) {
$dst_image = imagecreatetruecolor( $width, $height );
+ imagealphablending( $dst_image, false );
+ imagesavealpha( $dst_image, true );
+ imagecopyresampled( $dst_image, $src_image,
+ 0,0,0,0,
+ $width, $height, $this->width, $this->height );
} else {
- $dst_image = imagecreate( $width, $height );
+ $cmd = $wgImageMagickConvertCommand .
+ " -quality 85 -geometry {$width} ".
+ escapeshellarg($this->imagePath) . " " .
+ escapeshellarg($thumbPath);
+ $conv = shell_exec( $cmd );
+ $dst_image = imagecreatefrompng( $thumbPath );
+ $tmp_image = imagecreatefrompng( $thumbPath );
+ imagetruecolortopalette( $dst_image, 0, 255 );
+ imagecolormatch( $tmp_image, $dst_image );
}
- imagecopyresampled( $dst_image, $src_image,
- 0,0,0,0,
- $width, $height, $this->width, $this->height );
switch( $this->type ) {
case 1: # GIF
case 3: # PNG

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1137
Default Alt Text
ThumbnailPatch3.diff (1 KB)

Event Timeline