mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-22 07:26:47 +01:00
Load embedded album art from id3v2 tags
This commit is contained in:
parent
c43d695d8b
commit
2f11ee5d2b
@ -39,6 +39,7 @@
|
|||||||
#include <taglib/trueaudiofile.h>
|
#include <taglib/trueaudiofile.h>
|
||||||
#include <taglib/textidentificationframe.h>
|
#include <taglib/textidentificationframe.h>
|
||||||
#include <taglib/xiphcomment.h>
|
#include <taglib/xiphcomment.h>
|
||||||
|
#include <taglib/attachedpictureframe.h>
|
||||||
|
|
||||||
#include "radio/fixlastfm.h"
|
#include "radio/fixlastfm.h"
|
||||||
#include <lastfm/Track>
|
#include <lastfm/Track>
|
||||||
@ -368,6 +369,13 @@ void Song::InitFromFile(const QString& filename, int directory_id) {
|
|||||||
|
|
||||||
if (!file->ID3v2Tag()->frameListMap()["TCMP"].isEmpty())
|
if (!file->ID3v2Tag()->frameListMap()["TCMP"].isEmpty())
|
||||||
compilation = TStringToQString(file->ID3v2Tag()->frameListMap()["TCMP"].front()->toString()).trimmed();
|
compilation = TStringToQString(file->ID3v2Tag()->frameListMap()["TCMP"].front()->toString()).trimmed();
|
||||||
|
|
||||||
|
if (!file->ID3v2Tag()->frameListMap()["APIC"].isEmpty()) {
|
||||||
|
TagLib::ID3v2::AttachedPictureFrame* pic =
|
||||||
|
static_cast<TagLib::ID3v2::AttachedPictureFrame*>(
|
||||||
|
file->ID3v2Tag()->frameListMap()["APIC"].front());
|
||||||
|
d->image_.loadFromData((const uchar*) pic->picture().data(), pic->picture().size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TagLib::Ogg::Vorbis::File* file = dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) {
|
else if (TagLib::Ogg::Vorbis::File* file = dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user