Support remote filesystem (S3)

Created on 26 May 2025, 6 days ago

Problem/Motivation

My Drupal site is using s3fs module to store file

Steps to reproduce

The module is not able to manage remote file because imagick is not using (drupal) file wrappers.

In spatie/pdf-to-image/src/Pdf.php getImageData(),

$this->imagick->readImage(... this->filename) do not work with Drupal filename like public://file.pdf

Proposed resolution

See the patch proposed. When reading realpath for the pdf file, if the file is a remote file, then realpath is false. Then read file content and put it in a tempory local file and then use this temporary file to generate image preview.

Remaining tasks

review the patch.

User interface changes

no change

API changes

no change

Data model changes

no change

Feature request
Status

Needs review

Version

3.0

Component

Code

Created by

🇫🇷France blink38

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

Comments & Activities

Production build 0.71.5 2024