1
0
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:
Ramiro Araujo
2015-04-10 17:04:16 -03:00
parent e5259db76b
commit 96be781f7e

View File

@@ -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);
}