[wp-trac] [WordPress Trac] #45813: PDF preview images are not generated
WordPress Trac
noreply at wordpress.org
Wed Jan 2 20:36:24 UTC 2019
#45813: PDF preview images are not generated
--------------------------+------------------------------
Reporter: desrosj | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Description changed by desrosj:
Old description:
> I discovered this when the test suite started failing in my local
> environment using VVV.
>
> Recently, ImageMagick updated it's `policy.xml` file to
> [https://git.launchpad.net/ubuntu/+source/imagemagick/tree/debian/patches/300
> -disable-ghostscript-
> formats.patch?id=be94d865776b391a60323603b1cc002213c37c39 remove rights
> for PDF files from Ghostscript].
>
> After this change, a `WP_Error` is
> [https://core.trac.wordpress.org/browser/trunk/src/wp-
> admin/includes/image.php#L264 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:
New description:
I discovered this when the test suite started failing in my local
environment using VVV.
Recently, ImageMagick updated it's `policy.xml` file to
[https://git.launchpad.net/ubuntu/+source/imagemagick/tree/debian/patches/300
-disable-ghostscript-
formats.patch?id=be94d865776b391a60323603b1cc002213c37c39 remove rights
for PDF files from Ghostscript].
After this change, a `WP_Error` is
[https://core.trac.wordpress.org/browser/trunk/src/wp-
admin/includes/image.php#L264 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
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45813#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list