aguion alex at
Wed Jul 26 20:35:50 CEST 2006


I get a hard time trying to get the data of an attached picture. Even if I
just copy the data received directly to a file, the image is screwed up.
Here's my code :

frameList = id3v2Tag->frameListMap()["APIC"];
if(!frameList.isEmpty()) {
   TagLib::ID3v2::AttachedPictureFrame * pic =
static_cast<TagLib::ID3v2::AttachedPictureFrame *> (frameList.front());
    if (pic) {
      // embedded thumbnail
      CStringW mimetype = pic->mimeType().toCString();
      int fdout;
         return 1;
      int bytesWrote = _write(fdout,pic->picture().data(),pic->size() *
(sizeof(unsigned char)));

 If I change the writing of the file to be non binary, the data seem to be
better (a simple comparison of this file and the real picture shows that
half of the data are the same).
Do you have any idea what am I doing wrong ?
and why would a static_cast help me better than a simple cast (I saw the
static_cast on previous posts, didn't help me that much) ?

THanks for your answer

View this message in context:
Sent from the taglib-devel forum at

More information about the taglib-devel mailing list