Skip to content
Snippets Groups Projects
Commit f74403bd authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: remove heavy image cover data from audio file metadata

parent e98ec8c9
No related branches found
No related tags found
No related merge requests found
Pipeline #8516 passed
Pipeline: Castopod

#8517

    ...@@ -41,6 +41,10 @@ class Audio extends BaseMedia ...@@ -41,6 +41,10 @@ class Audio extends BaseMedia
    $getID3 = new GetID3(); $getID3 = new GetID3();
    $audioMetadata = $getID3->analyze(media_path($this->file_path)); $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_mimetype'] = $audioMetadata['mime_type'];
    $this->attributes['file_size'] = $audioMetadata['filesize']; $this->attributes['file_size'] = $audioMetadata['filesize'];
    $this->attributes['description'] = @$audioMetadata['id3v2']['comments']['comment'][0]; $this->attributes['description'] = @$audioMetadata['id3v2']['comments']['comment'][0];
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment