<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
There is probably a smarter way to do this, but here's basically what I
do:<br>
<br>
<tt>TagLib::MPEG::File file("mytrack.mp3");<br>
TagLib::ID3v2::Tag *tagv2 = file.ID3v2Tag();<br>
if(tagv2){<br>
TagLib::ID3v2::FrameListMap tags = tagv2->frameListMap();<br>
<br>
TagLib::ID3v2::FrameList pictures = tags["APIC"];<br>
if(!pictures.isEmpty()){<br>
// Thumbnail exists<br>
// Just get the front() picture<br>
TagLib::ID3v2::AttachedPictureFrame *picture =
static_cast<TagLib::ID3v2::AttachedPictureFrame*>(pictures.front());<br>
TagLib::ByteVector pictureData = picture->picture();<br>
<br>
int size = pictureData.size();<br>
char *data = pictureData.data();<br>
<br>
// Do something with the data<br>
<br>
}<br>
}<br>
</tt><br>
<br>
Best regards<br>
Daniel<br>
<br>
Jordi Hernández wrote:
<blockquote
cite="mid:1a0f6f6a0805200334y20886259g227338c194ca744@mail.gmail.com"
type="cite">Hi!<br>
<br>
I'm developing a quicklook for linux using opengl and I want to add
preview for many file types, one of them MP3, I found that your library
can extract the front cover but I get lost in how to do this<br>
<br>
Do you have any tutorial or a little piece of code where I can find
this simple function?<br>
<br>