WordPress.org

Make WordPress Core

Ticket #9887: indexPNG.patch

File indexPNG.patch, 582 bytes (added by madhyde, 11 years ago)

improve index PNG's thumnail

  • media.php

     
    352352
    353353        imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
    354354
     355        // convert from full colors to index colors, like original PNG.
     356        if( IMAGETYPE_PNG == $orig_type && !imageistruecolor( $image ) )
     357                imagetruecolortopalette( $newimage, false, imagecolorstotal( $image ) );
     358
    355359        // we don't need the original in memory anymore
    356360        imagedestroy( $image );
    357361