Last active
August 29, 2015 13:56
-
-
Save stmllr/8825791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Writing png image to file */ | |
$filename = vfsStream::url('root/test.png'); | |
// not testable with vfsStream | |
imagepng($image, $filename); | |
// Workaround, testable with vfsStream | |
ob_start(); | |
imagepng($image); | |
$imageRawData = ob_get_contents(); | |
ob_end_clean(); | |
file_put_contents($filename, $imageRawData); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment