go to bug id or search bugs for
exif_read_data currently read exif metadata only from filepath.
In case the image is in memory (stream resource, binary string, etc...) the image
as to be written on disk before reading the exif data.
It would be awesome to be able to read from a stream resource.
Add a Patch
Add a Pull Request
Closing it as it's actually already supported via
while the posted example will work, it requires a lot memory on php-side because you need to read the whole file + you need additional space for the base64 encoded string.
so its far away from an efficient solution and will not work for big/huge images.
After reading the comment of maggus dot staab at googlemail dot com, I reopen the ticket
It seems like all the exif_* functions do not support streams, I'm gonna take a look at it
I'm currently working on a patch, and a side thing that is coming out of this is an additional $context parameter for use with non streams, since internally PHP is creating a stream with no context, this can help work around supplying direct addresses like locations thats gated by custom protocols or HTTPS which would need peer verification or similar.
I expect this patch to only go in PHP 7.2 and onwards.
I have just implemented this in master, it will be available as of PHP 7.2.0 Beta 1!
Thanks for helping PHP become EVEN greater!
ps, it also works for exif_thumbnail()