exif_read_data() cannot use external URL

Created on 14 November 2023, about 1 year ago

Problem/Motivation

Similar to #2478099: Unable to read EXIF data when uploading to S3 Bucket. β†’ , EXIF headers are read correctly for files stored locally. However, when the file is located externally (e.g., using the Flysystem β†’ module) and uploaded using a widget that doesn't validate on image resolution (e.g., using the DropzoneJS β†’ module) the headers cannot be read, even if a valid stream resource is available.

Proposed resolution

Since PHP 7.2 both local and stream resources are supported. Therefore, rewrite in _exif_orientation_rotate() the code that transforms a URI into a path or external URL.

Remaining tasks

  1. Implement suggested changes
  2. Review MR
πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands watergate

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

Comments & Activities

  • Issue created by @watergate
  • @watergate opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • πŸ‡³πŸ‡±Netherlands watergate

    I've implemented the suggested change and opened a merge request.

    As stated in the issue description, the problem seems similar to #2478099: Unable to read EXIF data when uploading to S3 Bucket. β†’ . I've opened a new ticket since that ticket is about the Drupal 7 version of the module, and there seems to have already been some work/updates in the Drupal 8 (9/10) port/version.

  • Status changed to Needs work 3 months ago
  • πŸ‡¬πŸ‡§United Kingdom adamps

    The bug was already fixed in #3401728, however your fix is better. It needs merging.

  • πŸ‡¬πŸ‡§United Kingdom adamps

    I now have a patch that hopefully fixes this issue and several others in 🌱 Overall status Active . Please help to test and review.

  • πŸ‡ΊπŸ‡ΈUnited States msielski

    I needed this patch, stand-alone and against 8.x-1.5 so I'm just sharing a reroll of watergate's fix which I tested against local public:// as well as s3:// images.

Production build 0.71.5 2024