mirror of
https://github.com/Intervention/image.git
synced 2025-08-28 16:19:50 +02:00
Add EncodedImage::toFilePointer()
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user