WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 5 days ago

#45813 new defect (bug)

PDF preview images are not generated

Reported by: desrosj Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:
PR Number:

Description (last modified by desrosj)

I discovered this when the test suite started failing in my local environment using VVV.

Recently, ImageMagick updated it's policy.xml file to remove rights for PDF files from Ghostscript.

After this change, a WP_Error is returned by `wp_get_image_editor()` when a PDF file is passed. This prevents preview images from being generated and causes the test failures due to lack of metadata.

The PDF tests check that the selected image editor supports PDF images using wp_image_editor_supports() before running, but this does not seem to be catching this change (Imagick::queryFormats() indicates support for PDFs even when rights are removed).

This can be fixed bychanging the rights attribute for PDFs to read|write, or commenting out that line in the /etc/ImageMagick/policy.xml file.

More info: https://alexvanderbist.com/posts/2018/fixing-imagick-error-unauthorized

Change History (9)

#1 @desrosj
9 months ago

Ideally, wp_image_editor_supports() should catch this scenario and correctly indicate that the image editor does not support creating images from a PDF. But, this change will eventually lead to a decline in the number of servers that allow a site to generate preview images.

#2 @desrosj
9 months ago

  • Description modified (diff)

This ticket was mentioned in Slack in #hosting-community by desrosj. View the logs.


9 months ago

#4 @desrosj
9 months ago

  • Milestone changed from Awaiting Review to Future Release

This ticket was mentioned in Slack in #core-media by mike. View the logs.


5 months ago

This ticket was mentioned in Slack in #core-media by mike. View the logs.


3 months ago

#7 @mikeschroder
3 months ago

We chatted about this in the media meeting this week.

Quick note that I'd love to see a decision re:upstream fix and/or workaround during 5.3.

@desrosj do you want to lead that, or would you prefer someone else do so?
Feel free to assign to me if you'd like.

This ticket was mentioned in Slack in #core-media by mike. View the logs.


2 months ago

This ticket was mentioned in Slack in #core by mike. View the logs.


5 days ago

Note: See TracTickets for help on using tickets.