Problem/Motivation
After updating to PHP 8, we have an error saving images.
exif_read_data(): Argument #1 ($file) cannot be empty
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | exif_orientation-3220370-13.patch | 1.02 KB | solideogloria |
| #7 | exif_orientation-3220370-7-drupal7.patch | 969 bytes | solideogloria |
| #2 | empty-arg-exif-read-data-3220370-1.patch | 883 bytes | xpersonas |
Comments
Comment #2
xpersonas commentedComment #3
xpersonas commentedComment #4
manishsaharan commentedI had also faced the same issue, but applying patch #2 resolved my issue
Comment #5
sagesolutions commentedCan confirm patch #2 fixes the PHP 8.1 error
Comment #6
solideogloria commentedThe patches fixes the error for me as well.
However,
falseshould be in all caps,FALSE, to conform to Drupal's coding standards.Comment #7
solideogloria commentedHere's a Drupal 7 patch that also includes the patch for #3263166: Allow other mime types.
The section they patch are the same, so there are patch conflicts without manual adjustments. This should make that easier.
Comment #8
solideogloria commentedHere's a patch for Drupal 8+ that fixes both this issue and #3263166: Allow other mime types. (Again because of patch conflicts.)
I also used short array syntax.
Comment #9
joelpittetThis looks great back to RTBC
Comment #10
joelpittetComment #11
sokru commentedComment #12
solideogloria commentedThe patches all replaced
@exif_read_datawithexif_read_data. I now get warnings when using a PNG file (#3263166: Allow other mime types).@exif_read_datashould be used.Warning: exif_read_data(future-8-4-23.png): File not supported in _exif_orientation_rotate() (line 68 of /var/www/html/web/modules/contrib/exif_orientation/exif_orientation.module)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/web/modules/contrib/exif_orientation/exif_orientation.module(68): exif_read_data()
#3 /var/www/html/web/modules/contrib/exif_orientation/exif_orientation.module(17): _exif_orientation_rotate()
#4 [internal function]: exif_orientation_file_presave()
Comment #13
solideogloria commentedDrupal 8+ patch, same as before except I added
@Comment #14
joelpittetThat's fair though strange we explicitly check for png mime type, does it sometimes work?
Comment #15
solideogloria commentedIt works, but it just shows a warning.
https://www.php.net/manual/en/function.exif-read-data.php
Comment #17
heddn