[wp-trac] [WordPress Trac] #45982: PDF thumbnails have a default black background
WordPress Trac
noreply at wordpress.org
Mon Nov 18 16:33:32 UTC 2019
#45982: PDF thumbnails have a default black background
--------------------------+------------------------------
Reporter: nebrekab | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 5.0.3
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by joostdekeijzer):
With my patch (see comment above) and below code my pdf's are without
black backgrounds:
{{{#!php
<?php
add_action( 'imagick_load_after_read', function( $image, $filename,
$file_extension ) {
if ( 'pdf' === $file_extension ) {
$image->setImageAlphaChannel( Imagick::ALPHACHANNEL_REMOVE );
}
}, 10, 3 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45982#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list