Skip to content

Instantly share code, notes, and snippets.

@Spriz
Created July 18, 2019 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spriz/8a3ce743f012e7ecd1714642e2256ca8 to your computer and use it in GitHub Desktop.
Save Spriz/8a3ce743f012e7ecd1714642e2256ca8 to your computer and use it in GitHub Desktop.
$fp = fopen("php://temp/maxmemory:$fiveMBs", 'rb+');
//ADD STUF TO stream
$imageMagick->writeImageFile($fp);
rewind($fp);
return $this->response
->withType('png')
->withStringBody(stream_get_contents($fp));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment