@@ -5749,6 +5749,14 @@ SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
57495749SWIGINTERN size_t Exiv2_PreviewImage___len__ (Exiv2::PreviewImage *self){
57505750 return self->size ();
57515751 }
5752+ SWIGINTERN Exiv2::byte const *Exiv2_PreviewImage_data (Exiv2::PreviewImage *self){
5753+ return self->pData ();
5754+ }
5755+ SWIGINTERN Exiv2::byte const *Exiv2_PreviewImage_pData (Exiv2::PreviewImage *self){
5756+ PyErr_WarnEx (PyExc_DeprecationWarning,
5757+ " Please use data() instead of pData()." , 1 );
5758+ return self->pData ();
5759+ }
57525760
57535761 namespace swig {
57545762 template <> struct traits < Exiv2::PreviewProperties > {
@@ -6317,29 +6325,6 @@ SWIGINTERN PyObject *_wrap_PreviewImage_copy(PyObject *self, PyObject *args) {
63176325}
63186326
63196327
6320- SWIGINTERN PyObject *_wrap_PreviewImage_pData (PyObject *self, PyObject *args) {
6321- PyObject *resultobj = 0 ;
6322- Exiv2::PreviewImage *arg1 = (Exiv2::PreviewImage *) 0 ;
6323- void *argp1 = 0 ;
6324- int res1 = 0 ;
6325- Exiv2::byte *result = 0 ;
6326-
6327- if (!SWIG_Python_UnpackTuple (args, " PreviewImage_pData" , 0 , 0 , 0 )) SWIG_fail;
6328- res1 = SWIG_ConvertPtr (self, &argp1,SWIGTYPE_p_Exiv2__PreviewImage, 0 | 0 );
6329- if (!SWIG_IsOK (res1)) {
6330- SWIG_exception_fail (SWIG_ArgError (res1), " in method '" " PreviewImage_pData" " ', argument " " 1" " of type '" " Exiv2::PreviewImage const *" " '" );
6331- }
6332- arg1 = reinterpret_cast < Exiv2::PreviewImage * >(argp1);
6333- result = (Exiv2::byte *)((Exiv2::PreviewImage const *)arg1)->pData ();
6334-
6335- resultobj = PyMemoryView_FromMemory ((char *)result, arg1->size (), PyBUF_READ);
6336-
6337- return resultobj;
6338- fail:
6339- return NULL ;
6340- }
6341-
6342-
63436328SWIGINTERN PyObject *_wrap_PreviewImage_size (PyObject *self, PyObject *args) {
63446329 PyObject *resultobj = 0 ;
63456330 Exiv2::PreviewImage *arg1 = (Exiv2::PreviewImage *) 0 ;
@@ -6555,6 +6540,60 @@ SWIGINTERN PyObject *_wrap_PreviewImage___len__(PyObject *self, PyObject *args)
65556540}
65566541
65576542
6543+ SWIGINTERN PyObject *_wrap_PreviewImage_data (PyObject *self, PyObject *args) {
6544+ PyObject *resultobj = 0 ;
6545+ Exiv2::PreviewImage *arg1 = (Exiv2::PreviewImage *) 0 ;
6546+ void *argp1 = 0 ;
6547+ int res1 = 0 ;
6548+ Exiv2::byte *result = 0 ;
6549+
6550+ if (!SWIG_Python_UnpackTuple (args, " PreviewImage_data" , 0 , 0 , 0 )) SWIG_fail;
6551+ res1 = SWIG_ConvertPtr (self, &argp1,SWIGTYPE_p_Exiv2__PreviewImage, 0 | 0 );
6552+ if (!SWIG_IsOK (res1)) {
6553+ SWIG_exception_fail (SWIG_ArgError (res1), " in method '" " PreviewImage_data" " ', argument " " 1" " of type '" " Exiv2::PreviewImage *" " '" );
6554+ }
6555+ arg1 = reinterpret_cast < Exiv2::PreviewImage * >(argp1);
6556+ {
6557+ try {
6558+ result = (Exiv2::byte *)Exiv2_PreviewImage_data (arg1);
6559+ }
6560+ catch (std::exception const & e) {
6561+ _set_python_exception ();
6562+ SWIG_fail;
6563+ }
6564+ }
6565+
6566+ resultobj = PyMemoryView_FromMemory ((char *)result, arg1->size (), PyBUF_READ);
6567+
6568+ return resultobj;
6569+ fail:
6570+ return NULL ;
6571+ }
6572+
6573+
6574+ SWIGINTERN PyObject *_wrap_PreviewImage_pData (PyObject *self, PyObject *args) {
6575+ PyObject *resultobj = 0 ;
6576+ Exiv2::PreviewImage *arg1 = (Exiv2::PreviewImage *) 0 ;
6577+ void *argp1 = 0 ;
6578+ int res1 = 0 ;
6579+ Exiv2::byte *result = 0 ;
6580+
6581+ if (!SWIG_Python_UnpackTuple (args, " PreviewImage_pData" , 0 , 0 , 0 )) SWIG_fail;
6582+ res1 = SWIG_ConvertPtr (self, &argp1,SWIGTYPE_p_Exiv2__PreviewImage, 0 | 0 );
6583+ if (!SWIG_IsOK (res1)) {
6584+ SWIG_exception_fail (SWIG_ArgError (res1), " in method '" " PreviewImage_pData" " ', argument " " 1" " of type '" " Exiv2::PreviewImage *" " '" );
6585+ }
6586+ arg1 = reinterpret_cast < Exiv2::PreviewImage * >(argp1);
6587+ result = (Exiv2::byte *)Exiv2_PreviewImage_pData (arg1);
6588+
6589+ resultobj = PyMemoryView_FromMemory ((char *)result, arg1->size (), PyBUF_READ);
6590+
6591+ return resultobj;
6592+ fail:
6593+ return NULL ;
6594+ }
6595+
6596+
65586597SWIGPY_DESTRUCTOR_CLOSURE (_wrap_delete_PreviewImage) /* defines _wrap_delete_PreviewImage_destructor_closure */
65596598
65606599SWIGPY_LENFUNC_CLOSURE (_wrap_PreviewImage___len__) /* defines _wrap_PreviewImage___len___lenfunc_closure */
@@ -7110,13 +7149,6 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__PreviewImage_methods[] = {
71107149 " Return a copy of the preview image data. The caller owns\n "
71117150 " this copy and %DataBuf ensures that it will be deleted.\n "
71127151 " " },
7113- { " pData" , _wrap_PreviewImage_pData, METH_NOARGS , " \n "
7114- " Returns a temporary Python memoryview of the object's data.\n "
7115- " \n "
7116- " WARNING: do not resize or delete the object while using the view.\n "
7117- " \n "
7118- " :rtype: memoryview\n "
7119- " " },
71207152 { " size" , _wrap_PreviewImage_size, METH_NOARGS , " Return the size of the preview image in bytes." },
71217153 { " writeFile" , _wrap_PreviewImage_writeFile, METH_O , " \n "
71227154 " Write the thumbnail image to a file.\n "
@@ -7142,6 +7174,20 @@ SWIGINTERN PyMethodDef SwigPyBuiltin__Exiv2__PreviewImage_methods[] = {
71427174 { " height" , _wrap_PreviewImage_height, METH_NOARGS , " Return the height of the preview image in pixels." },
71437175 { " id" , _wrap_PreviewImage_id, METH_NOARGS , " Return the preview image type identifier." },
71447176 { " __len__" , _wrap_PreviewImage___len__, METH_NOARGS , " " },
7177+ { " data" , _wrap_PreviewImage_data, METH_NOARGS , " \n "
7178+ " Returns a temporary Python memoryview of the object's data.\n "
7179+ " \n "
7180+ " WARNING: do not resize or delete the object while using the view.\n "
7181+ " \n "
7182+ " :rtype: memoryview\n "
7183+ " " },
7184+ { " pData" , _wrap_PreviewImage_pData, METH_NOARGS , " \n "
7185+ " Returns a temporary Python memoryview of the object's data.\n "
7186+ " \n "
7187+ " WARNING: do not resize or delete the object while using the view.\n "
7188+ " \n "
7189+ " :rtype: memoryview\n "
7190+ " " },
71457191 { NULL , NULL , 0 , NULL } /* Sentinel */
71467192};
71477193
0 commit comments