Skip to content

Commit

Permalink
Merge pull request #137 from jackmu95/rewind-error-fix
Browse files Browse the repository at this point in the history
Make sure stream is seekable before using `rewind()`
  • Loading branch information
reinink authored Jun 13, 2016
2 parents 0dd3e4e + 2df074a commit 4218b54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ public function outputImage($path, array $params)

$stream = $this->cache->readStream($path);

rewind($stream);
if (ftell($stream) !== 0) {
rewind($stream);
}
fpassthru($stream);
fclose($stream);
}
Expand Down

0 comments on commit 4218b54

Please sign in to comment.