fix: remove heavy image cover data from audio file metadata

This commit is contained in:
Yassine Doghri 2022-09-23 10:10:21 +00:00
parent e98ec8c950
commit f74403bd7a
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ class Audio extends BaseMedia
$getID3 = new GetID3();
$audioMetadata = $getID3->analyze(media_path($this->file_path));
// remove heavy image data from metadata
unset($audioMetadata['comments']['picture']);
unset($audioMetadata['id3v2']['APIC']);
$this->attributes['file_mimetype'] = $audioMetadata['mime_type'];
$this->attributes['file_size'] = $audioMetadata['filesize'];
$this->attributes['description'] = @$audioMetadata['id3v2']['comments']['comment'][0];