imagick performance problem

Created on 19 June 2023, about 1 year ago
Updated 20 August 2023, 10 months ago

Problem/Motivation

Processing of PDF files takes alot of resources and is very slow.

Steps to reproduce

Generate a PDF Image of a PDF with 160 or more pages.

Proposed resolution

The Media PDF Thumbnail Module utilizes the URI instead of the realpath. For instance, it employs the format public://foo/bar.pdf.

When the path is remote, the spartie/pdf-to-image library generates images for every page of the PDF. It verifies whether the path is remote by using the filter_var($path, FILTER_VALIDATE_URL) function. However, when a Drupal URI is provided, the spartie/pdf-to-image library mistakenly considers the file as remote and proceeds to generate images for all pages.

Consequently, when dealing with PDF files that contain numerous pages, imagick consumes a significant amount of temporary space on the server.

I provided a patch to fix the issue.

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Ayrmax

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

Comments & Activities

Production build 0.69.0 2024