Merge pull request #28 from kesselb/guard-get-cover
fix: add string as return for getCover and make sure to not pass false to fseek
This commit is contained in:
commit
a28101d523
@ -235,7 +235,7 @@ class Mp3Info {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|null
|
* @return bool|null|string
|
||||||
*/
|
*/
|
||||||
public function getCover()
|
public function getCover()
|
||||||
{
|
{
|
||||||
@ -244,6 +244,9 @@ class Mp3Info {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fp = fopen($this->_fileName, 'rb');
|
$fp = fopen($this->_fileName, 'rb');
|
||||||
|
if ($fp === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
fseek($fp, $this->coverProperties['offset']);
|
fseek($fp, $this->coverProperties['offset']);
|
||||||
$data = fread($fp, $this->coverProperties['size']);
|
$data = fread($fp, $this->coverProperties['size']);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user