#46318 closed defect (bug) (duplicate)
Black backgrounds in PDF thumbnails
Reported by: | rdiazg | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.1 |
Component: | Media | Keywords: | has-screenshots |
Focuses: | Cc: |
Description
When an user upload some pdfs which contain alpha layers to the media library, the thumbnail preview appears with a unwanted black background. Imagemagick's functions "class-wp-image-editor-imagick.php" not support hooks or filters to fix this behaviour. For testing purposes I was trying fix this with some code like:
<?php if ( 'pdf' == $file_extension ) { $this->image->setImageAlphaChannel(Imagick::ALPHACHANNEL_REMOVE); $this->image->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN); }
in
And it's works for me but I don't know how this change affect to the others wordpress features that call this method. Could someone have a look at this?
Thanks in advance.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi there and welcome to Trac!
It looks like we are already tracking this in #45982. Let's discuss possible solutions there.