Avoid callouts to ImageMagick, etc.

Created on 21 February 2016, about 9 years ago
Updated 18 June 2024, 10 months ago

My hosting service blocks system callouts, so calls to ImageMagick don't work. However, the same can be achieved using PHP's Imagick module. I have recoded pdfpreview.module to use this approach (it's code I already used on the site I'm converting from).

It may be possible to use Drupal's Imagick interface, which would be purer Drupal style, but I haven't investigated.

I've attached a revised version of pdfpreview.module (as a txt file), which also fixes the display of descriptions, and makes "link to file" link to the PDF rather than the image. This is based on the 7.x-2.1+19-dev release (I can't identify what has changed in 7.x-2.1+20-dev, very little I think).

The dependency on the imagemagick module can also be removed from pdfpreview.info. It doesn't actually depend on the imagick Drupal module either, just requires Imagick in PHP.

I hope this posting doesn't contravene any etiquette, I'm a relative Drupal newbie (but with a 30-year career of development behind me!). These fixes works for me, I'm posting for other's interest and comments at this time.

🌱 Plan
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom rickj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024