Problem/Motivation

In the event that the image toolkit is used on a large PDF file.

It spawns a ghostscript process in the background for every single page within the PDF, which ends up needlessly using up loads of server resources, and can sometimes lead to zombie processes being left behing when a PHP timeout occurs.

Steps to reproduce

1. Set Imagick as the default toolkit.
2. Attempt to call something along the lines of this with lots of pages:

// e.g. https://research.nhm.org/pdfs/10840/10840.pdf
\Drupal::service('image.factory')->get('public://my-very-large.pdf');

Proposed resolution

For files with multiple pages, unless specified in the source file, only the first page should ideally be loaded by default.

Remaining tasks

Provide MR.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork imagick-3557449

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

codebymikey created an issue. See original summary.

codebymikey’s picture

Title: Ensure that only the first page of images is processed » Ensure that only the first page of PDFs is processed
Status: Active » Needs review