Unsolved Taglib OGG CoverArt
-
Hi,
I want to get coverart of ogg files with taglib. I want to be able to get a QImage from the coverart. I searched the internet but I couldn't find a good solution. Can someone help? -
Hi
disclaimer: I dont know taglib.http://stackoverflow.com/questions/6542465/c-taglib-cover-art-from-mpeg-4-files
he seems to get image this way
image.loadFromData((const uchar *) coverArt.data().data(),coverArt.data().size());
So I wonder if it works for ogg too? -
No it does not. I tried to treat the ogg file like m4a or mp3 bu it didn't work. I got these to functions for getting images:
QImage Music::imageForTag(TagLib::ID3v2::Tag *tag)
{
TagLib::ID3v2::FrameList l = tag->frameList("APIC");QImage image; if(l.isEmpty()) return image; TagLib::ID3v2::AttachedPictureFrame *f = static_cast<TagLib::ID3v2::AttachedPictureFrame *>(l.front()); image.loadFromData((const uchar *) f->picture().data(), f->picture().size()); return image;
}
QImage Music::imageForTagMP4(TagLib::MP4::Tag *tag)
{
QImage image;if (tag->isEmpty()) return image; TagLib::MP4::ItemListMap itemsListMap = tag->itemListMap(); TagLib::MP4::Item coverItem = itemsListMap["covr"]; TagLib::MP4::CoverArtList coverArtList = coverItem.toCoverArtList(); TagLib::MP4::CoverArt coverArt = coverArtList.front(); image.loadFromData((const uchar *) coverArt.data().data(),coverArt.data().size()); return image;
}
-
Hi
I dont think ogg files have cover art. ( not as default)
http://stackoverflow.com/questions/4752020/how-do-i-use-taglib-to-read-write-coverart-in-different-audio-formats -
It says it is officially not supported. then I will set the default coverart icon for them.
One more problem:
I have a QMenu in my QMenuBar and it has an icon and a title. when I run the project it shows the icon but when I click on it it shows the title but I want it to show the icon. what should I do? -
@shahriar25
Hi, if I create a default project and create a menu item and set its icon.
the icon and text is displayed all the time so not sure what happens to your icon/text. -
@mrjj
Hi, see it your self:http://i68.tinypic.com/fu9pq9.png
can I set the menu to only show the icon?
-
What happens if you don't set text for the menu item?
-
@jsulm
when you don't click on it it shows the icon and when you do it becomes empty