[wp-trac] [WordPress Trac] #45982: PDF thumbnails have a default black background
WordPress Trac
noreply at wordpress.org
Thu Nov 12 14:14:30 UTC 2020
#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 tofuSCHNITZEL):
Replying to [comment:8 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 );
>
> }}}
I think this is a great idea... did you add a pull request for the hook @
(https://github.com/WordPress/wordpress-develop) maybe this would help
move things along?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45982#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list