Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#46318 closed defect (bug) (duplicate)

Black backgrounds in PDF thumbnails

Reported by: rdiazg's profile rdiazg Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Media Keywords: has-screenshots
Focuses: Cc:


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:

            if ( 'pdf' == $file_extension ) {


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)

PDF_BLACK_BACKGROUND.png (13.6 KB) - added by rdiazg 5 years ago.

Download all attachments as: .zip

Change History (3)

#1 @swissspidy
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there and welcome to Trac!

It looks like we are already tracking this in #45982. Let's discuss possible solutions there.

#2 @rdiazg
5 years ago

Sure, thanks for your quick reply :)

Note: See TracTickets for help on using tickets.