Exemplo n.º 1
2
ByteVector ID3v2::Tag::albumArt(TagLib::ID3v2::AttachedPictureFrame::Type arttype, TagLib::String &mimetype)
{
	if(!d->frameListMap["APIC"].isEmpty()) {
		ID3v2::AttachedPictureFrame *f = (ID3v2::AttachedPictureFrame *)d->frameListMap["APIC"].front();
		mimetype = f->mimeType();
		if(f->type() == arttype) {
			return f->picture();
		} else {
			// do nothing
		}
	} else {
		// do nothing
	}
	return ByteVector();
}
Exemplo n.º 2
0
 void testCompressedFrameWithBrokenLength()
 {
   MPEG::File f(TEST_FILE_PATH_C("compressed_id3_frame.mp3"), false);
   CPPUNIT_ASSERT(f.ID3v2Tag()->frameListMap().contains("APIC"));
   ID3v2::AttachedPictureFrame *frame =
       static_cast<TagLib::ID3v2::AttachedPictureFrame*>(f.ID3v2Tag()->frameListMap()["APIC"].front());
   CPPUNIT_ASSERT(frame);
   CPPUNIT_ASSERT_EQUAL(String("image/bmp"), frame->mimeType());
   CPPUNIT_ASSERT_EQUAL(ID3v2::AttachedPictureFrame::Other, frame->type());
   CPPUNIT_ASSERT_EQUAL(String(""), frame->description());
   CPPUNIT_ASSERT_EQUAL(TagLib::uint(86414), frame->picture().size());
 }