<div dir="ltr">I have upgraded from 1.7 to 1.9.1, and have very little clue about the taglib code, as I have inherited it.<div><br></div><div>We used to have no issue reading the embedded artwork, and now it fails. </div><div>
<br></div><div><div style="font-family:arial,sans-serif;font-size:13px">We have a method , extractEmbeddedArtwork(QString path)</div><div style="font-family:arial,sans-serif;font-size:13px">{</div><div style="font-family:arial,sans-serif;font-size:13px">
QFileInfo finfo(path);</div><div style="font-family:arial,sans-serif;font-size:13px"> QString ext = finfo.suffix().toLower();</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
#ifdef Q_OS_WIN32</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap"> </span>// TAGLIB (under Windows) does not like UTF8 paths/filenames with top-bit-set characters.</div><div style="font-family:arial,sans-serif;font-size:13px">
<span style="white-space:pre-wrap"> </span>// (conversion from UTF8 to const wchar_t seems to be the cause of the problem - file</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap"> </span>// is effectively not recognised as an audio file and will therefore not be loaded)</div>
<div style="font-family:arial,sans-serif;font-size:13px"> FileRef f( reinterpret_cast<const wchar_t*>(path.constData()) );</div><div style="font-family:arial,sans-serif;font-size:13px">#else</div><div style="font-family:arial,sans-serif;font-size:13px">
<span style="white-space:pre-wrap"> </span>// No such problem with UTF8 for Mac and Linux versions.</div><div style="font-family:arial,sans-serif;font-size:13px"> FileRef f(QFile::encodeName(path).constData());</div>
<div style="font-family:arial,sans-serif;font-size:13px">#endif<span style="white-space:pre-wrap"> </span></div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">
if (!f.tag()) {</div><div style="font-family:arial,sans-serif;font-size:13px"> //qDebug() << "no tags in" << path;</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap"> </span>qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> no tags in" << path;</div>
<div style="font-family:arial,sans-serif;font-size:13px"> return QByteArray();</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><div><font face="arial, sans-serif">MPEG::File* mpegFile = dynamic_cast<MPEG::File*>(f.file());</font></div>
<div><font face="arial, sans-serif"> if (mpegFile) {</font></div><div><font face="arial, sans-serif">//<span class="" style="white-space:pre"> </span>qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking MP3 file" << path;</font></div>
<div><font face="arial, sans-serif"> return extractID3Artwork(path, mpegFile->ID3v2Tag());</font></div><div><font face="arial, sans-serif"> } // of MPEG case</font></div><div><font face="arial, sans-serif"> </font></div>
<div><font face="arial, sans-serif"> RIFF::AIFF::File* aiffFile = dynamic_cast<RIFF::AIFF::File*>(f.file());</font></div><div><font face="arial, sans-serif"> if (aiffFile) {</font></div><div><font face="arial, sans-serif">//<span class="" style="white-space:pre"> </span>qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking AIFF file" << path;</font></div>
<div><font face="arial, sans-serif"> return extractID3Artwork(path, aiffFile->tag());</font></div><div><font face="arial, sans-serif"> }</font></div><div><font face="arial, sans-serif"> </font></div><div><font face="arial, sans-serif"> RIFF::WAV::File* wavFile = dynamic_cast<RIFF::WAV::File*>(f.file());</font></div>
<div><font face="arial, sans-serif"> if (wavFile) {</font></div><div><font face="arial, sans-serif">//<span class="" style="white-space:pre"> </span>qDebug() << ".........[ARTWORK] extractEmbeddedArtwork() -> checking WAV file" << path;</font></div>
<div><font face="arial, sans-serif"> return extractID3Artwork(path, wavFile->tag());</font></div><div><font face="arial, sans-serif"> }</font></div></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">When the code gets into (if(!t.tag()) it fails and returns, before trying to extract artwork.</div>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Could someone give me a clue as to where to start here? Has something changed here that I am not noticing underneath??</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Gayle Reid</div></div>