in case the image is big, this will use a lot of memory (base64 will use 33% more memory than the image has in size).
Would it make sense to dump the image to a file (if it is not already one) and let `exif_read_data` read from the file. This would not eat php's memory, but might be slower.