diff --git a/src/EncodedImage.php b/src/EncodedImage.php index a0461d84..d1014497 100644 --- a/src/EncodedImage.php +++ b/src/EncodedImage.php @@ -38,6 +38,15 @@ class EncodedImage return $this->data; } + public function toFilePointer() + { + $pointer = fopen('php://temp', 'rw'); + fputs($pointer, $this->toString()); + rewind($pointer); + + return $pointer; + } + public function __toString(): string { return $this->toString();