Unable to generate PDF thumbnails due to missing Imagick Extension

Thumbnails are not being generated for uploaded PDFs. Attempting to directly create the thumbnail via imagick throws an error.

Fatal error: Uncaught ImagickException: PostscriptDelegateFailed [ghostscript library 9.53] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 ‘-sDEVICE=bmpsep8’ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 ‘-r10x10’ -dFirstPage=1 -dLastPage=1 ‘-sOutputFile=/var/tmp/magick-bCWyxRbUkTq3A8KBgX3pim2c63Xaqn0i%d’ ‘-f/var/tmp/magick-iZjoxTprxxdRJbTJwmiGLZivJyuicvGn’ ‘-f/var/tmp/magick-gdhhGN4qXL99XngxbSTptneNqAuws3s7’’: GPL Ghostscript 9.53.3: Can’t find initialization file gs_init.ps. @ error/ghostscript-private.h/InvokeGhostscriptDelegate/178 `

This happens in all sites served via Local.

The issue can be recreated by starting a new site and uploading a PDF. It happens with any version of PHP and nginx/Apache.

Currently using Local 6.1.0+5452 on macOS Big Sur 11.4

I haven’t done any QA on this yet, but from googling, it sounds like this might be an issue with WP core?

Since that thread mentions things breaking on WP core 5.3.1 you might try downgrading WP on one of the sites and see if that fixes things.

The easiest way to downgrade the core version of WP is to right-click on a site, and select “Open Site Shell”

From there, run this command to install a specific version of WP:

wp core update --version='5.3' --force 

I’m pretty sure it’s not WP related. Multiple versions including the one I’m testing on work on WP Engine and SiteGround hosting but fail in Local. Also, it throws an error when trying to generate a thumbnail from a PDF directly through PHP without using WP. Here’s the generic test script I ran which worked on the remote hosting but errored in Local:

What version of PHP are you running? I know that PHP 8 doesn’t support Imagick yet:

I’ve tried it on 7.3.5 and 7.4.1

Thank you so much for bringing this up!

I did some more QA and it looks like this is a regression with our PHP lightning services. I’ve created a bug to get this fixed.

1 Like

Also, just so there’s a little more transparency, it looks like the main issue is that the actual imagick.so library isn’t linked correctly within PHP 7.4.1.

Here’s a rambling brain-dump screenshot of what I’m seeing:

Is this something that might be fixed in a future release or are there steps I should take from my end to fix it?

Sorry that I wasn’t more clear! Yep, this is something that I’ve created a bug for, but I don’t have a specific ETA for when it will be fixed.

I know it isn’t ideal, but as a work around, you should be able to update the php.ini.hbs file for a site and point to the full path where the extension is located. After updating that file, restart the Local site so that the configuration is regenerated!

Here’s a screenshot to help visualize:

Hey @hereswhatidid – we’re trying a new process by creating an actual bug category here in the forums.

I’ve moved this support topic here so that you or anyone else can up-vote this issue to show our team how important this is.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.