mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-30 16:17:56 +02:00
Generate same as original color depth thumbnails for PNG images, props madhyde, fixes #9887
git-svn-id: http://svn.automattic.com/wordpress/trunk@11737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
14047212f2
commit
2cc87216e8
@ -352,6 +352,10 @@ function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_p
|
|||||||
|
|
||||||
imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||||
|
|
||||||
|
// convert from full colors to index colors, like original PNG.
|
||||||
|
if ( IMAGETYPE_PNG == $orig_type && !imageistruecolor( $image ) )
|
||||||
|
imagetruecolortopalette( $newimage, false, imagecolorstotal( $image ) );
|
||||||
|
|
||||||
// we don't need the original in memory anymore
|
// we don't need the original in memory anymore
|
||||||
imagedestroy( $image );
|
imagedestroy( $image );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user