exif_read_data() does not work with stream wrappers and that will make reading EXIF data fail on with non local files (i.e. if you are using the storage module).

The attached patch fixes this by copying non local streams to a local temporary file before reading the EXIF data.

Also _exif_get_data_from_file_uri() is called numerous times so it makes sense to cache the EXIF data in a static variable - especially with the copy approach mentioned above. The attached patch also implements this caching.drupal_unlink

Comments

arnested’s picture

arnested’s picture

Status: Active » Needs review
jphautin’s picture

Assigned: Unassigned » jphautin

jphautin’s picture

Category: Bug report » Feature request
Issue summary: View changes

thanks for the patch.
patch merged in 7.x-1.x branch for test

arnested’s picture

So could the status be changed to Fixed now?

jphautin’s picture

Hello,

I am waiting for some feedback before closing the issue.

regards,

scotwith1t’s picture

Status: Needs review » Reviewed & tested by the community

This saved my day with a site using S3 for image storage. I was banging my head against trying to do my own EXIF implementation and tried this module and it wasn't working at first until I realized it was because of the remote file system and this made it super-simple in our custom module to just depend on this module (the latest dev, with this patch, of course!) and call _exif_get_data_from_file_uri. Thanks!!

jphautin’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.