summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-04-06 18:32:18 +0200
committerLukas Reschke <lukas@owncloud.com>2016-04-06 18:32:18 +0200
commit9b930cd01d2a536cfa21ba08a3be737cdfe4e54b (patch)
treea1f12fc84b9a98262a26960baeb7a642455433f3
parent90c853614d23a418e417e1e89d5187a429f5877f (diff)
parentcc5a2b549ef0f2142431b57c0f08144e5fd7928e (diff)
downloadnextcloud-server-9b930cd01d2a536cfa21ba08a3be737cdfe4e54b.tar.gz
nextcloud-server-9b930cd01d2a536cfa21ba08a3be737cdfe4e54b.zip
Merge pull request #23766 from owncloud/replace-getid-3
Replace getid3 with ID3Parser
m---------3rdparty0
-rw-r--r--lib/private/preview/mp3.php16
2 files changed, 10 insertions, 6 deletions
diff --git a/3rdparty b/3rdparty
-Subproject 35a8125ac1dc2325da8da5529f50b3881e1b240
+Subproject de4313cda759a88745fbc5b5aaaca5e3644b361
diff --git a/lib/private/preview/mp3.php b/lib/private/preview/mp3.php
index b984cb4e10d..c7b70457afe 100644
--- a/lib/private/preview/mp3.php
+++ b/lib/private/preview/mp3.php
@@ -23,6 +23,8 @@
*/
namespace OC\Preview;
+use ID3Parser\ID3Parser;
+
class MP3 extends Provider {
/**
* {@inheritDoc}
@@ -35,15 +37,17 @@ class MP3 extends Provider {
* {@inheritDoc}
*/
public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
- $getID3 = new \getID3();
+ $getID3 = new ID3Parser();
$tmpPath = $fileview->toTmpFile($path);
-
$tags = $getID3->analyze($tmpPath);
- \getid3_lib::CopyTagsToComments($tags);
- if(isset($tags['id3v2']['APIC'][0]['data'])) {
- $picture = @$tags['id3v2']['APIC'][0]['data'];
- unlink($tmpPath);
+ unlink($tmpPath);
+ $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null;
+ if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) {
+ $picture = $tags['id3v2']['PIC'][0]['data'];
+ }
+
+ if(!is_null($picture)) {
$image = new \OC_Image();
$image->loadFromData($picture);