Skip to content

Commit

Permalink
Fix log exceptions for mp3 preview (#41153)
Browse files Browse the repository at this point in the history
* fix: log exceptions for mp3 preview

* fix: add changelog

* fix: use loadFromFileHandle instead
  • Loading branch information
Pasquale Tripodi authored Jan 17, 2024
1 parent 620e6c4 commit cb5e983
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/41153
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix log exceptions for mp3 preview

This change fixes log exceptions when previews for mp3 files are being created

https://github.com/owncloud/core/pull/41153
4 changes: 3 additions & 1 deletion lib/private/Preview/MP3.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ private function getNoCoverThumbnail() {
return false;
}

$stream = \fopen($icon, 'r');
$image = new \OC_Image();
$image->loadFromFile($icon);
$image->loadFromFileHandle($stream);
\fclose($stream);
return $image->valid() ? $image : false;
}

Expand Down

0 comments on commit cb5e983

Please sign in to comment.