static PyObject *taglib_error;
static PyObject *
-taglib_apic(const char *fn, const char *image, int len, const char *type)
+taglib_apic(const char *fn, const char *image, int len,
+ int type, const char *mime_type)
{
TagLib::ByteVector *bv;
TagLib::ID3v2::AttachedPictureFrame *p;
/* Um, look at all these void-returning functions. I'm sure they
* can fail, i just have no way to detect it... */
- p->setMimeType(type);
- p->setType(TagLib::ID3v2::AttachedPictureFrame::FrontCover);
+ p->setType((TagLib::ID3v2::AttachedPictureFrame::Type)type);
+ p->setMimeType(mime_type);
p->setPicture(*bv);
/* GAH! Opening the file is entangled with allocating the object;
static PyObject *
add_apic_frame_to_mp3(PyObject *self, PyObject *args)
{
- const char *fn, *image, *type;
- int len;
+ const char *fn, *image, *mime_type;
+ int len, type;
- if (!PyArg_ParseTuple(args, "ss#s", &fn, &image, &len, &type)) {
+ if (!PyArg_ParseTuple(args, "ss#is", &fn, &image, &len,
+ &type, &mime_type)) {
return 0;
}
- return taglib_apic(fn, image, len, type);
+ return taglib_apic(fn, image, len, type, mime_type);
}
static