Make WordPress Core


Ignore:
Timestamp:
05/02/2012 09:35:56 PM (14 years ago)
Author:
ryan
Message:

Don't convert png to jpg when cropping a header. Prevents stomping transparency. Props SergeyBiryukov, kovshenin. fixes #20555

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r20384 r20706  
    859859        $url = str_replace(basename($parent_url), basename($cropped), $parent_url);
    860860
     861        $size = @getimagesize( $cropped );
     862        $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
     863
    861864        // Construct the object array
    862865        $object = array(
     
    864867            'post_title' => basename($cropped),
    865868            'post_content' => $url,
    866             'post_mime_type' => 'image/jpeg',
     869            'post_mime_type' => $image_type,
    867870            'guid' => $url,
    868871            'context' => 'custom-header'
Note: See TracChangeset for help on using the changeset viewer.