mirror of
https://github.com/Intervention/image.git
synced 2025-08-19 04:01:30 +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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user