you are right that `exif_read_data` does not support streams ATM. There is a PHP Bug for this topic https://bugs.php.net/bug.php?id=65187.

The solution you posted will nevertheless save a lot memory on php-side... I tried the example and on my dev machine it looks like there is 1 char missing at the of the string.

```
<?php

$string = 'Some bad-ass string';

$stream = fopen('php://memory','r+');
stream_filter_append($stream, 'convert.base64-encode', STREAM_FILTER_READ);
fwrite($stream, $string);
rewind($stream);


$native = stream_get_contents($stream);
echo base64_decode($native); // will output "Some bad-ass strin", so the "g" is missing
```

Not sure why it works in other apps I`ve written before.