Taglib 1.9.1 upgrade not reading embedded artwork

Gayle Reid wifanlith at googlemail.com
Thu Oct 17 09:46:49 UTC 2013

I have upgraded from 1.7 to 1.9.1, and have very little clue about the
taglib code, as I have inherited it.

We used to have no issue reading the embedded artwork, and now it fails.

We have a method , extractEmbeddedArtwork(QString path)
      QFileInfo finfo(path);
      QString ext = finfo.suffix().toLower();

#ifdef Q_OS_WIN32
// TAGLIB (under Windows) does not like UTF8 paths/filenames with
top-bit-set characters.
// (conversion from UTF8 to const wchar_t seems to be the cause of the
problem - file
// is effectively not recognised as an audio file and will therefore not be
        FileRef f( reinterpret_cast<const wchar_t*>(path.constData()) );
//  No such problem with UTF8 for Mac and Linux versions.
        FileRef f(QFile::encodeName(path).constData());

    if (!f.tag()) {
        //qDebug() << "no tags in" << path;
qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> no tags in" <<
        return QByteArray();

MPEG::File* mpegFile = dynamic_cast<MPEG::File*>(f.file());
    if (mpegFile) {
// qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking MP3
file" << path;
        return extractID3Artwork(path, mpegFile->ID3v2Tag());
    } // of MPEG case

    RIFF::AIFF::File* aiffFile = dynamic_cast<RIFF::AIFF::File*>(f.file());
    if (aiffFile) {
// qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking
AIFF file" << path;
        return extractID3Artwork(path, aiffFile->tag());

    RIFF::WAV::File* wavFile = dynamic_cast<RIFF::WAV::File*>(f.file());
    if (wavFile) {
// qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking WAV
file" << path;
        return extractID3Artwork(path, wavFile->tag());

When the code gets into  (if(!t.tag()) it fails and returns, before trying
to extract artwork.

Could someone give me a clue as to where to start here? Has something
changed here that I am not noticing underneath??


Gayle Reid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20131017/04931f2e/attachment.html>

More information about the taglib-devel mailing list