Remote files (Amazon S3) and file destination on save

Created on 14 July 2016, almost 9 years ago
Updated 24 April 2025, about 15 hours ago

Problem/Motivation

Non-local image files (that do not have a realpath) are not loaded and moving image files to their permanent destination (S3) results in an error, due to the format prefix (e.g. "JPEG:/tmp/image.png").

Proposed resolution

For loading the remote file, conduct a check similar to the one at the beginning of image_imagick_save() and open a regular file stream for reading only, feeding it to the ImageMagick object.
For the file move on save, simply remove the format prefix before calling file_unmanaged_move() in image_imagick_save().

Remaining tasks

  • In image_imagick_load(), check the resource returned by fopen() and throw an exception on error.
  • In image_imagick_load(), find out if a file name is desired (second argument taken by ImageMagick::readImageFile()).

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pivanov

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