From 5d76b8eaae27e7721801002faaab79c908376f58 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Sun, 12 Apr 2020 05:29:33 +0200 Subject: [PATCH] vorbis: Add comment picture support (#65) --- vorbis.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vorbis.go b/vorbis.go index 057eb6e..416ec32 100644 --- a/vorbis.go +++ b/vorbis.go @@ -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 }