[mutagen] Extract just front cover APIC

154 views
Skip to first unread message

klo

unread,
Feb 28, 2012, 11:19:11 PM2/28/12
to quod-libet-...@googlegroups.com
Hi,

I tried mutagen to get embed cover from mp3.
Package seems robust but no documentation can I found, except trivial examples

So I try to extract cover:

++++++++++++++++++++++++++++++++++++++++
from mutagen.id3 import ID3
f = ID3(<my mp3 file>).getall('APIC')
open('dump', 'wb').write(f[0].data)
========================================

This way I always get last APIC frame. Last in sense if I open mp3 with hex editor then I get last APIC frame

How do I tell mutagen I want type 3 APIC (front cover) only?

TIA

Christoph Reiter

unread,
Feb 29, 2012, 4:56:11 AM2/29/12
to quod-libet-...@googlegroups.com

klo

unread,
Feb 29, 2012, 10:08:16 AM2/29/12
to quod-libet-...@googlegroups.com
On Wednesday, February 29, 2012 10:56:11 AM UTC+1, Christoph Reiter wrote:
http://code.google.com/p/quodlibet/source/browse/quodlibet/quodlibet/formats/_id3.py#360

http://code.google.com/p/mutagen/source/browse/trunk/mutagen/id3.py#1559


Well, I looked in APIC class before asking, but couldn't find my way assigning type=3 :(
What I should have done, is to snip in QL source :)

Thanks
Reply all
Reply to author
Forward
0 new messages