mirror of
https://github.com/taglib/taglib.git
synced 2025-11-13 05:02:54 -05:00
Add FLAC::Picture support to Xiph Comment
This commit is contained in:
@ -21,6 +21,7 @@ class TestOGG : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testDictInterface1);
|
||||
CPPUNIT_TEST(testDictInterface2);
|
||||
CPPUNIT_TEST(testAudioProperties);
|
||||
CPPUNIT_TEST(testPicture);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -134,6 +135,33 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(112000, f.audioProperties()->bitrateNominal());
|
||||
CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrateMinimum());
|
||||
}
|
||||
|
||||
void testPicture()
|
||||
{
|
||||
ScopedFileCopy copy("empty", ".ogg");
|
||||
string newname = copy.fileName();
|
||||
|
||||
Vorbis::File *f = new Vorbis::File(newname.c_str());
|
||||
FLAC::Picture *newpic = new FLAC::Picture();
|
||||
newpic->setType(FLAC::Picture::BackCover);
|
||||
newpic->setWidth(5);
|
||||
newpic->setHeight(6);
|
||||
newpic->setColorDepth(16);
|
||||
newpic->setNumColors(7);
|
||||
newpic->setMimeType("image/jpeg");
|
||||
newpic->setDescription("new image");
|
||||
newpic->setData("JPEG data");
|
||||
f->tag()->addPicture(newpic);
|
||||
f->save();
|
||||
delete f;
|
||||
|
||||
f = new Vorbis::File(newname.c_str());
|
||||
List<FLAC::Picture *> lst = f->tag()->pictureList();
|
||||
CPPUNIT_ASSERT_EQUAL(TagLib::uint(1), lst.size());
|
||||
delete f;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestOGG);
|
||||
|
||||
Reference in New Issue
Block a user