Skip to content

Commit

Permalink
Merge pull request #28 from kesselb/guard-get-cover
Browse files Browse the repository at this point in the history
fix: add string as return for getCover and make sure to not pass false to fseek
  • Loading branch information
wapmorgan authored May 28, 2023
2 parents 534c305 + c75f4e0 commit a28101d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mp3Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function __construct($filename, $parseTags = false) {


/**
* @return bool|null
* @return bool|null|string
*/
public function getCover()
{
Expand All @@ -244,6 +244,9 @@ public function getCover()
}

$fp = fopen($this->_fileName, 'rb');
if ($fp === false) {
return false;
}
fseek($fp, $this->coverProperties['offset']);
$data = fread($fp, $this->coverProperties['size']);
fclose($fp);
Expand Down

0 comments on commit a28101d

Please sign in to comment.