mirror of
https://github.com/Intervention/image.git
synced 2025-08-20 04:31:24 +02:00
rewind stream to read, but leave original pointer where it was
This commit is contained in:
@@ -78,7 +78,11 @@ abstract class AbstractDecoder
|
|||||||
*/
|
*/
|
||||||
public function initFromStream($stream)
|
public function initFromStream($stream)
|
||||||
{
|
{
|
||||||
if ($data = @stream_get_contents($stream)){
|
$offset = ftell($stream);
|
||||||
|
rewind($stream);
|
||||||
|
$data = @stream_get_contents($stream);
|
||||||
|
fseek($stream, $offset);
|
||||||
|
if ($data) {
|
||||||
return $this->initFromBinary($data);
|
return $this->initFromBinary($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user