mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 18:28:08 +01:00
Merge pull request #23766 from owncloud/replace-getid-3
Replace getid3 with ID3Parser
This commit is contained in:
2
3rdparty
2
3rdparty
Submodule 3rdparty updated: 35a8125ac1...de4313cda7
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user