Skip to content

Commit

Permalink
Make more dataset and tag info available to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-easterbrook committed Dec 2, 2023
1 parent d05306a commit d38bd13
Show file tree
Hide file tree
Showing 25 changed files with 1,267 additions and 1,097 deletions.
13 changes: 13 additions & 0 deletions src/interface/datasets.i
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@

wrap_auto_unique_ptr(Exiv2::IptcKey);

// IptcDataSets::application2RecordList and IptcDataSets::envelopeRecordList
// return a static list as a pointer
%typemap(out) const Exiv2::DataSet* {
const Exiv2::DataSet* ptr = $1;
PyObject* list = PyList_New(0);
while (ptr->number_ != 0xffff) {
PyList_Append(list, SWIG_NewPointerObj(
SWIG_as_voidptr(ptr), $descriptor(Exiv2::DataSet*), 0));
++ptr;
}
$result = SWIG_Python_AppendOutput($result, PyList_AsTuple(list));
}

%ignore Exiv2::RecordInfo::RecordInfo;
%ignore Exiv2::DataSet::DataSet;
%ignore Exiv2::IptcDataSets::dataSetList;
Expand Down
12 changes: 12 additions & 0 deletions src/interface/tags.i
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ wrap_auto_unique_ptr(Exiv2::ExifKey);
$result = SWIG_Python_AppendOutput($result, PyList_AsTuple(list));
}

// GroupInfo::tagList_ returns a function pointer
%typemap(out) const Exiv2::TagInfo*(*)() {
const Exiv2::TagInfo* ti = $1();
PyObject* list = PyList_New(0);
while (ti->tag_ != 0xFFFF) {
PyList_Append(list, SWIG_NewPointerObj(
SWIG_as_voidptr(ti), $descriptor(Exiv2::TagInfo*), 0));
++ti;
}
$result = SWIG_Python_AppendOutput($result, PyList_AsTuple(list));
}

%ignore Exiv2::GroupInfo::GroupInfo;
%ignore Exiv2::GroupInfo::GroupName;
%ignore Exiv2::TagInfo::TagInfo;
Expand Down
22 changes: 20 additions & 2 deletions src/swig-0_27_0/datasets_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5159,7 +5159,16 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_envelopeRecordList(PyObject *self, PyObj
SWIG_fail;
}
}
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__DataSet, 0 | 0 );
{
const Exiv2::DataSet* ptr = result;
PyObject* list = PyList_New(0);
while (ptr->number_ != 0xffff) {
PyList_Append(list, SWIG_NewPointerObj(
SWIG_as_voidptr(ptr), SWIGTYPE_p_Exiv2__DataSet, 0));
++ptr;
}
resultobj = SWIG_Python_AppendOutput(resultobj, PyList_AsTuple(list));
}
return resultobj;
fail:
return NULL;
Expand All @@ -5184,7 +5193,16 @@ SWIGINTERN PyObject *_wrap_IptcDataSets_application2RecordList(PyObject *self, P
SWIG_fail;
}
}
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Exiv2__DataSet, 0 | 0 );
{
const Exiv2::DataSet* ptr = result;
PyObject* list = PyList_New(0);
while (ptr->number_ != 0xffff) {
PyList_Append(list, SWIG_NewPointerObj(
SWIG_as_voidptr(ptr), SWIGTYPE_p_Exiv2__DataSet, 0));
++ptr;
}
resultobj = SWIG_Python_AppendOutput(resultobj, PyList_AsTuple(list));
}
return resultobj;
fail:
return NULL;
Expand Down
159 changes: 82 additions & 77 deletions src/swig-0_27_0/image_wrap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3753,83 +3753,84 @@ SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
#define SWIGTYPE_p_Exiv2__BasicIo swig_types[4]
#define SWIGTYPE_p_Exiv2__CommentValue swig_types[5]
#define SWIGTYPE_p_Exiv2__DataBuf swig_types[6]
#define SWIGTYPE_p_Exiv2__DataValue swig_types[7]
#define SWIGTYPE_p_Exiv2__DateValue swig_types[8]
#define SWIGTYPE_p_Exiv2__ExifData swig_types[9]
#define SWIGTYPE_p_Exiv2__ExifKey swig_types[10]
#define SWIGTYPE_p_Exiv2__FileIo swig_types[11]
#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[12]
#define SWIGTYPE_p_Exiv2__HttpIo swig_types[13]
#define SWIGTYPE_p_Exiv2__Image swig_types[14]
#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[15]
#define SWIGTYPE_p_Exiv2__IptcData swig_types[16]
#define SWIGTYPE_p_Exiv2__IptcKey swig_types[17]
#define SWIGTYPE_p_Exiv2__Key swig_types[18]
#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[19]
#define SWIGTYPE_p_Exiv2__MemIo swig_types[20]
#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[21]
#define SWIGTYPE_p_Exiv2__StringValue swig_types[22]
#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[23]
#define SWIGTYPE_p_Exiv2__TagInfo swig_types[24]
#define SWIGTYPE_p_Exiv2__TimeValue swig_types[25]
#define SWIGTYPE_p_Exiv2__Value swig_types[26]
#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[27]
#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[28]
#define SWIGTYPE_p_Exiv2__ValueTypeT_int_t swig_types[29]
#define SWIGTYPE_p_Exiv2__ValueTypeT_short_t swig_types[30]
#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[31]
#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[32]
#define SWIGTYPE_p_Exiv2__ValueTypeT_unsigned_int_t swig_types[33]
#define SWIGTYPE_p_Exiv2__ValueTypeT_unsigned_short_t swig_types[34]
#define SWIGTYPE_p_Exiv2__XPathIo swig_types[35]
#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[36]
#define SWIGTYPE_p_Exiv2__XmpData swig_types[37]
#define SWIGTYPE_p_Exiv2__XmpKey swig_types[38]
#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[39]
#define SWIGTYPE_p_Exiv2__XmpValue swig_types[40]
#define SWIGTYPE_p_IptcData_iterator swig_types[41]
#define SWIGTYPE_p_IptcData_iterator_end swig_types[42]
#define SWIGTYPE_p_NsRegistry swig_types[43]
#define SWIGTYPE_p_SwigPyObject swig_types[44]
#define SWIGTYPE_p_ValueList swig_types[45]
#define SWIGTYPE_p_ValueType swig_types[46]
#define SWIGTYPE_p_XmpData_iterator swig_types[47]
#define SWIGTYPE_p_XmpData_iterator_end swig_types[48]
#define SWIGTYPE_p_allocator_type swig_types[49]
#define SWIGTYPE_p_char swig_types[50]
#define SWIGTYPE_p_const_iterator swig_types[51]
#define SWIGTYPE_p_difference_type swig_types[52]
#define SWIGTYPE_p_first_type swig_types[53]
#define SWIGTYPE_p_int swig_types[54]
#define SWIGTYPE_p_iterator swig_types[55]
#define SWIGTYPE_p_key_type swig_types[56]
#define SWIGTYPE_p_long_long swig_types[57]
#define SWIGTYPE_p_mapped_type swig_types[58]
#define SWIGTYPE_p_second_type swig_types[59]
#define SWIGTYPE_p_short swig_types[60]
#define SWIGTYPE_p_signed_char swig_types[61]
#define SWIGTYPE_p_size_type swig_types[62]
#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[63]
#define SWIGTYPE_p_std__mapT_std__string_std__string_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_std__string_t_t_t swig_types[64]
#define SWIGTYPE_p_std__mapT_std__string_std__string_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_std__string_t_t_t__const_iterator swig_types[65]
#define SWIGTYPE_p_std__pairT_int_int_t swig_types[66]
#define SWIGTYPE_p_std__pairT_unsigned_int_unsigned_int_t swig_types[67]
#define SWIGTYPE_p_std__setT_std__string_t swig_types[68]
#define SWIGTYPE_p_std__setT_std__string_t__const_iterator swig_types[69]
#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[70]
#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[71]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[72]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t__const_iterator swig_types[73]
#define SWIGTYPE_p_std__vectorT_unsigned_char_std__allocatorT_unsigned_char_t_t swig_types[74]
#define SWIGTYPE_p_std__vectorT_unsigned_int_std__allocatorT_unsigned_int_t_t swig_types[75]
#define SWIGTYPE_p_std__vectorT_unsigned_int_std__allocatorT_unsigned_int_t_t__const_iterator swig_types[76]
#define SWIGTYPE_p_unsigned_char swig_types[77]
#define SWIGTYPE_p_unsigned_int swig_types[78]
#define SWIGTYPE_p_unsigned_long_long swig_types[79]
#define SWIGTYPE_p_unsigned_short swig_types[80]
#define SWIGTYPE_p_value_type swig_types[81]
static swig_type_info *swig_types[83];
static swig_module_info swig_module = {swig_types, 82, 0, 0, 0, 0};
#define SWIGTYPE_p_Exiv2__DataSet swig_types[7]
#define SWIGTYPE_p_Exiv2__DataValue swig_types[8]
#define SWIGTYPE_p_Exiv2__DateValue swig_types[9]
#define SWIGTYPE_p_Exiv2__ExifData swig_types[10]
#define SWIGTYPE_p_Exiv2__ExifKey swig_types[11]
#define SWIGTYPE_p_Exiv2__FileIo swig_types[12]
#define SWIGTYPE_p_Exiv2__GroupInfo swig_types[13]
#define SWIGTYPE_p_Exiv2__HttpIo swig_types[14]
#define SWIGTYPE_p_Exiv2__Image swig_types[15]
#define SWIGTYPE_p_Exiv2__ImageFactory swig_types[16]
#define SWIGTYPE_p_Exiv2__IptcData swig_types[17]
#define SWIGTYPE_p_Exiv2__IptcKey swig_types[18]
#define SWIGTYPE_p_Exiv2__Key swig_types[19]
#define SWIGTYPE_p_Exiv2__LangAltValue swig_types[20]
#define SWIGTYPE_p_Exiv2__MemIo swig_types[21]
#define SWIGTYPE_p_Exiv2__RemoteIo swig_types[22]
#define SWIGTYPE_p_Exiv2__StringValue swig_types[23]
#define SWIGTYPE_p_Exiv2__StringValueBase swig_types[24]
#define SWIGTYPE_p_Exiv2__TagInfo swig_types[25]
#define SWIGTYPE_p_Exiv2__TimeValue swig_types[26]
#define SWIGTYPE_p_Exiv2__Value swig_types[27]
#define SWIGTYPE_p_Exiv2__ValueTypeT_double_t swig_types[28]
#define SWIGTYPE_p_Exiv2__ValueTypeT_float_t swig_types[29]
#define SWIGTYPE_p_Exiv2__ValueTypeT_int_t swig_types[30]
#define SWIGTYPE_p_Exiv2__ValueTypeT_short_t swig_types[31]
#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_int32_t_int32_t_t_t swig_types[32]
#define SWIGTYPE_p_Exiv2__ValueTypeT_std__pairT_uint32_t_uint32_t_t_t swig_types[33]
#define SWIGTYPE_p_Exiv2__ValueTypeT_unsigned_int_t swig_types[34]
#define SWIGTYPE_p_Exiv2__ValueTypeT_unsigned_short_t swig_types[35]
#define SWIGTYPE_p_Exiv2__XPathIo swig_types[36]
#define SWIGTYPE_p_Exiv2__XmpArrayValue swig_types[37]
#define SWIGTYPE_p_Exiv2__XmpData swig_types[38]
#define SWIGTYPE_p_Exiv2__XmpKey swig_types[39]
#define SWIGTYPE_p_Exiv2__XmpTextValue swig_types[40]
#define SWIGTYPE_p_Exiv2__XmpValue swig_types[41]
#define SWIGTYPE_p_IptcData_iterator swig_types[42]
#define SWIGTYPE_p_IptcData_iterator_end swig_types[43]
#define SWIGTYPE_p_NsRegistry swig_types[44]
#define SWIGTYPE_p_SwigPyObject swig_types[45]
#define SWIGTYPE_p_ValueList swig_types[46]
#define SWIGTYPE_p_ValueType swig_types[47]
#define SWIGTYPE_p_XmpData_iterator swig_types[48]
#define SWIGTYPE_p_XmpData_iterator_end swig_types[49]
#define SWIGTYPE_p_allocator_type swig_types[50]
#define SWIGTYPE_p_char swig_types[51]
#define SWIGTYPE_p_const_iterator swig_types[52]
#define SWIGTYPE_p_difference_type swig_types[53]
#define SWIGTYPE_p_first_type swig_types[54]
#define SWIGTYPE_p_int swig_types[55]
#define SWIGTYPE_p_iterator swig_types[56]
#define SWIGTYPE_p_key_type swig_types[57]
#define SWIGTYPE_p_long_long swig_types[58]
#define SWIGTYPE_p_mapped_type swig_types[59]
#define SWIGTYPE_p_second_type swig_types[60]
#define SWIGTYPE_p_short swig_types[61]
#define SWIGTYPE_p_signed_char swig_types[62]
#define SWIGTYPE_p_size_type swig_types[63]
#define SWIGTYPE_p_std__listT_Exiv2__Exifdatum_t swig_types[64]
#define SWIGTYPE_p_std__mapT_std__string_std__string_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_std__string_t_t_t swig_types[65]
#define SWIGTYPE_p_std__mapT_std__string_std__string_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_std__string_t_t_t__const_iterator swig_types[66]
#define SWIGTYPE_p_std__pairT_int_int_t swig_types[67]
#define SWIGTYPE_p_std__pairT_unsigned_int_unsigned_int_t swig_types[68]
#define SWIGTYPE_p_std__setT_std__string_t swig_types[69]
#define SWIGTYPE_p_std__setT_std__string_t__const_iterator swig_types[70]
#define SWIGTYPE_p_std__vectorT_Exiv2__Iptcdatum_std__allocatorT_Exiv2__Iptcdatum_t_t swig_types[71]
#define SWIGTYPE_p_std__vectorT_Exiv2__Xmpdatum_std__allocatorT_Exiv2__Xmpdatum_t_t swig_types[72]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[73]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t__const_iterator swig_types[74]
#define SWIGTYPE_p_std__vectorT_unsigned_char_std__allocatorT_unsigned_char_t_t swig_types[75]
#define SWIGTYPE_p_std__vectorT_unsigned_int_std__allocatorT_unsigned_int_t_t swig_types[76]
#define SWIGTYPE_p_std__vectorT_unsigned_int_std__allocatorT_unsigned_int_t_t__const_iterator swig_types[77]
#define SWIGTYPE_p_unsigned_char swig_types[78]
#define SWIGTYPE_p_unsigned_int swig_types[79]
#define SWIGTYPE_p_unsigned_long_long swig_types[80]
#define SWIGTYPE_p_unsigned_short swig_types[81]
#define SWIGTYPE_p_value_type swig_types[82]
static swig_type_info *swig_types[84];
static swig_module_info swig_module = {swig_types, 83, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

Expand Down Expand Up @@ -7727,6 +7728,7 @@ static swig_type_info _swigt__p_Exiv2__RemoteIo = {"_p_Exiv2__RemoteIo", 0, 0, 0
static swig_type_info _swigt__p_Exiv2__XPathIo = {"_p_Exiv2__XPathIo", 0, 0, 0, 0, 0};
static swig_type_info _swigt__p_Exiv2__CommentValue = {"_p_Exiv2__CommentValue", "Exiv2::CommentValue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Exiv2__DataBuf = {"_p_Exiv2__DataBuf", "Exiv2::DataBuf *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Exiv2__DataSet = {"_p_Exiv2__DataSet", "Exiv2::DataSet *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Exiv2__DataValue = {"_p_Exiv2__DataValue", "Exiv2::DataValue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Exiv2__DateValue = {"_p_Exiv2__DateValue", "Exiv2::DateValue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Exiv2__ExifData = {"_p_Exiv2__ExifData", "Exiv2::ExifData *", 0, 0, (void*)0, 0};
Expand Down Expand Up @@ -7806,6 +7808,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_Exiv2__BasicIo,
&_swigt__p_Exiv2__CommentValue,
&_swigt__p_Exiv2__DataBuf,
&_swigt__p_Exiv2__DataSet,
&_swigt__p_Exiv2__DataValue,
&_swigt__p_Exiv2__DateValue,
&_swigt__p_Exiv2__ExifData,
Expand Down Expand Up @@ -7895,6 +7898,7 @@ static swig_cast_info _swigc__p_Exiv2__XPathIo[] = {{&_swigt__p_Exiv2__XPathIo,
static swig_cast_info _swigc__p_Exiv2__BasicIo[] = { {&_swigt__p_Exiv2__BasicIo, 0, 0, 0}, {&_swigt__p_Exiv2__FileIo, _p_Exiv2__FileIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__HttpIo, _p_Exiv2__HttpIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__MemIo, _p_Exiv2__MemIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__RemoteIo, _p_Exiv2__RemoteIoTo_p_Exiv2__BasicIo, 0, 0}, {&_swigt__p_Exiv2__XPathIo, _p_Exiv2__XPathIoTo_p_Exiv2__BasicIo, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__CommentValue[] = { {&_swigt__p_Exiv2__CommentValue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__DataBuf[] = { {&_swigt__p_Exiv2__DataBuf, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__DataSet[] = { {&_swigt__p_Exiv2__DataSet, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__DataValue[] = { {&_swigt__p_Exiv2__DataValue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__DateValue[] = { {&_swigt__p_Exiv2__DateValue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Exiv2__ExifData[] = { {&_swigt__p_Exiv2__ExifData, 0, 0, 0},{0, 0, 0, 0}};
Expand Down Expand Up @@ -7974,6 +7978,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_Exiv2__BasicIo,
_swigc__p_Exiv2__CommentValue,
_swigc__p_Exiv2__DataBuf,
_swigc__p_Exiv2__DataSet,
_swigc__p_Exiv2__DataValue,
_swigc__p_Exiv2__DateValue,
_swigc__p_Exiv2__ExifData,
Expand Down
Loading

0 comments on commit d38bd13

Please sign in to comment.