vorbis: Add comment picture support (#65)

This commit is contained in:
Mattias Wadman 2020-04-12 05:29:33 +02:00 committed by GitHub
parent 869a70545f
commit 5d76b8eaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@
package tag
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"io"
@ -56,6 +58,15 @@ func (m *metadataVorbis) readVorbisComment(r io.Reader) error {
}
m.c[strings.ToLower(k)] = v
}
if b64data, ok := m.c["metadata_block_picture"]; ok {
data, err := base64.StdEncoding.DecodeString(b64data)
if err != nil {
return err
}
m.readPictureBlock(bytes.NewReader(data))
}
return nil
}