mutagen: writing cover tag in ogg

183 views
Skip to first unread message

gebi

unread,
Jul 20, 2011, 3:19:25 AM7/20/11
to Quod Libet Development
Just playing around with mutagen. I have problems writing coverart
into ogg files.

for falc this sample program does the job:

from mutagen.flac import FLAC, Picture
from mutagen import File

test2=File('/home/gebi/Music/myflac.flac')
test2.clear_pictures() # clear a pics
image = Picture()
image.type = 3
image.mime = 'image/jpeg'
image.desc = 'front cover'
image.data = open('/home/gebi/test2.jpg', 'r').read()
#test2.clear_pictures() # clear a pics
test2.add_picture(image) # and overwrite them
test2.save()


but howto do something similar for oggvorbis files ?

from mutagen.oggvorbis import OggVorbis
# But for ogg I do not have
test3=File('/home/gebi/Music/myogg.ogg')
test3.add_picture(image)

an add_picture method ?

thanks

ps: I found some complicated code like
http://hg.tuohela.net/banana/file/1a0526c9b62c/modules/banana/vorbis_albumart.py

directly writing the 'metadata_block_picture'

anything simpler around ?



Christoph Reiter

unread,
Jul 26, 2011, 7:30:34 AM7/26/11
to Quod Libet Development
On Jul 20, 9:19 am, gebi <g...@fastmail.fm> wrote:
> Just playing around with mutagen. I have problems writing coverart
> into ogg files.

There is no official way for embedding covers in vorbiscomment.

http://code.google.com/p/quodlibet/source/detail?r=0df2a9d0e0d24b340ba84410ea8852cf0583267c
http://code.google.com/p/quodlibet/source/browse/quodlibet/quodlibet/formats/xiph.py#63
http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE
Reply all
Reply to author
Forward
0 new messages