Make WordPress Core

Changeset 11737


Ignore:
Timestamp:
07/22/2009 03:02:44 AM (17 years ago)
Author:
azaozz
Message:

Generate same as original color depth thumbnails for PNG images, props madhyde, fixes #9887

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r11529 r11737  
    352352
    353353        imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
     354       
     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 ) );
    354358
    355359        // we don't need the original in memory anymore
Note: See TracChangeset for help on using the changeset viewer.