Generate same as original color depth thumbnails for PNG images, props madhyde, fixes #9887
git-svn-id: https://develop.svn.wordpress.org/trunk@11737 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fcda8f6d13
commit
b4b59e27e5
|
@ -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);
|
||||
|
||||
// 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
|
||||
imagedestroy( $image );
|
||||
|
||||
|
|
Loading…
Reference in New Issue