Skip to content

Commit e6f964a

Browse files
Deprecated Metadatum copy and write methods
1 parent 02f6881 commit e6f964a

File tree

14 files changed

+90
-17
lines changed

14 files changed

+90
-17
lines changed

CHANGELOG.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ Changes in v0.18.0:
2525
3/ Deprecated copy, write, and read(buffer) methods of Value (and
2626
subclasses) that should not be needed in Python scripts. Please let me
2727
know if this is a problem.
28-
4/ Deprecated 'buffer interface' to BasicIo, DataBuf, and PreviewImage. They
28+
4/ Deprecated copy and write methods of Metadatum (and subclasses) that
29+
should not be needed in Python scripts. Please let me know if this is a
30+
problem.
31+
5/ Deprecated 'buffer interface' to BasicIo, DataBuf, and PreviewImage. They
2932
all have 'data()' to get their contents.
30-
5/ Added binary wheels for Linux on arm64.
31-
6/ Exiv2 struct member names with a trailing underscore have more Pythonic
33+
6/ Added binary wheels for Linux on arm64.
34+
7/ Exiv2 struct member names with a trailing underscore have more Pythonic
3235
aliases without the underscore.
33-
7/ Add data() method to exiv2.PreviewImage, deprecate pData() method.
34-
8/ BasicIo.read (& readOrThrow) now extract count from the buffer size.
35-
9/ Invalidate data iterators if data is deleted. (Requires swig >= 4.4)
36+
8/ Add data() method to exiv2.PreviewImage, deprecate pData() method.
37+
9/ BasicIo.read (& readOrThrow) now extract count from the buffer size.
38+
10/ Invalidate data iterators if data is deleted. (Requires swig >= 4.4)
3639

3740
Changes in v0.17.3:
3841
1/ Binary wheels incorporate libexiv2 v0.28.5.

src/interface/metadatum.i

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,15 @@ static PyObject* set_value_from_py(datum_type* datum, PyObject* py_value) {
119119
std::string toString() const { return self->toString(); }
120120
std::string toString(BUFLEN_T i) const { return self->toString(i); }
121121
}
122+
// Deprecate some methods since 2025-08-25
123+
DEPRECATE_FUNCTION(datum_type::copy, true)
124+
DEPRECATE_FUNCTION(datum_type::write, true)
122125
%enddef // EXTEND_METADATUM
123126

127+
// Deprecate some base class methods since 2025-08-25
128+
DEPRECATE_FUNCTION(Exiv2::Metadatum::copy, true)
129+
DEPRECATE_FUNCTION(Exiv2::Metadatum::write, true)
130+
124131
// Extend base type
125132
%feature("python:slot", "tp_str", functype="reprfunc")
126133
Exiv2::Metadatum::__str__;

src/swig-0_27_7/exif_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6315,6 +6315,8 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
63156315
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
63166316
}
63176317
{
6318+
PyErr_WarnEx(PyExc_DeprecationWarning,
6319+
"Python scripts should not need to call ""Exiv2::Exifdatum::copy", 1);
63186320
try {
63196321
result = (long)(*arg1)->copy(arg2,arg3);
63206322
}
@@ -6376,6 +6378,8 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_write(PyObject *self, PyObject *arg
63766378
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
63776379
}
63786380
{
6381+
PyErr_WarnEx(PyExc_DeprecationWarning,
6382+
"Python scripts should not need to call ""Exiv2::Exifdatum::write", 1);
63796383
try {
63806384
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
63816385
}
@@ -7784,6 +7788,8 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
77847788
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
77857789
}
77867790
{
7791+
PyErr_WarnEx(PyExc_DeprecationWarning,
7792+
"Python scripts should not need to call ""Exiv2::Exifdatum::copy", 1);
77877793
try {
77887794
result = (long)((Exiv2::Exifdatum const *)arg1)->copy(arg2,arg3);
77897795
}
@@ -7845,6 +7851,8 @@ SWIGINTERN PyObject *_wrap_Exifdatum_write(PyObject *self, PyObject *args) {
78457851
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
78467852
}
78477853
{
7854+
PyErr_WarnEx(PyExc_DeprecationWarning,
7855+
"Python scripts should not need to call ""Exiv2::Exifdatum::write", 1);
78487856
try {
78497857
result = (std::ostream *) &((Exiv2::Exifdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
78507858
}

src/swig-0_27_7/iptc_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5969,6 +5969,8 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
59695969
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
59705970
}
59715971
{
5972+
PyErr_WarnEx(PyExc_DeprecationWarning,
5973+
"Python scripts should not need to call ""Exiv2::Iptcdatum::copy", 1);
59725974
try {
59735975
result = (long)(*arg1)->copy(arg2,arg3);
59745976
}
@@ -6030,6 +6032,8 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_write(PyObject *self, PyObject *arg
60306032
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
60316033
}
60326034
{
6035+
PyErr_WarnEx(PyExc_DeprecationWarning,
6036+
"Python scripts should not need to call ""Exiv2::Iptcdatum::write", 1);
60336037
try {
60346038
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
60356039
}
@@ -7323,6 +7327,8 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
73237327
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
73247328
}
73257329
{
7330+
PyErr_WarnEx(PyExc_DeprecationWarning,
7331+
"Python scripts should not need to call ""Exiv2::Iptcdatum::copy", 1);
73267332
try {
73277333
result = (long)((Exiv2::Iptcdatum const *)arg1)->copy(arg2,arg3);
73287334
}
@@ -7384,6 +7390,8 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_write(PyObject *self, PyObject *args) {
73847390
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
73857391
}
73867392
{
7393+
PyErr_WarnEx(PyExc_DeprecationWarning,
7394+
"Python scripts should not need to call ""Exiv2::Iptcdatum::write", 1);
73877395
try {
73887396
result = (std::ostream *) &((Exiv2::Iptcdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
73897397
}

src/swig-0_27_7/metadatum_wrap.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5699,6 +5699,8 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
56995699
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
57005700
}
57015701
{
5702+
PyErr_WarnEx(PyExc_DeprecationWarning,
5703+
"Python scripts should not need to call ""Exiv2::Metadatum::copy", 1);
57025704
try {
57035705
result = (long)((Exiv2::Metadatum const *)arg1)->copy(arg2,arg3);
57045706
}
@@ -5760,6 +5762,8 @@ SWIGINTERN PyObject *_wrap_Metadatum_write(PyObject *self, PyObject *args) {
57605762
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
57615763
}
57625764
{
5765+
PyErr_WarnEx(PyExc_DeprecationWarning,
5766+
"Python scripts should not need to call ""Exiv2::Metadatum::write", 1);
57635767
try {
57645768
result = (std::ostream *) &((Exiv2::Metadatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
57655769
}

src/swig-0_27_7/xmp_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5917,6 +5917,8 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_copy(PyObject *self, PyObject *args)
59175917
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
59185918
}
59195919
{
5920+
PyErr_WarnEx(PyExc_DeprecationWarning,
5921+
"Python scripts should not need to call ""Exiv2::Xmpdatum::copy", 1);
59205922
try {
59215923
result = (long)(*arg1)->copy(arg2,arg3);
59225924
}
@@ -5978,6 +5980,8 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_write(PyObject *self, PyObject *args
59785980
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
59795981
}
59805982
{
5983+
PyErr_WarnEx(PyExc_DeprecationWarning,
5984+
"Python scripts should not need to call ""Exiv2::Xmpdatum::write", 1);
59815985
try {
59825986
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
59835987
}
@@ -7213,6 +7217,8 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_copy(PyObject *self, PyObject *args) {
72137217
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
72147218
}
72157219
{
7220+
PyErr_WarnEx(PyExc_DeprecationWarning,
7221+
"Python scripts should not need to call ""Exiv2::Xmpdatum::copy", 1);
72167222
try {
72177223
result = (long)((Exiv2::Xmpdatum const *)arg1)->copy(arg2,arg3);
72187224
}
@@ -7274,6 +7280,8 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_write(PyObject *self, PyObject *args) {
72747280
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
72757281
}
72767282
{
7283+
PyErr_WarnEx(PyExc_DeprecationWarning,
7284+
"Python scripts should not need to call ""Exiv2::Xmpdatum::write", 1);
72777285
try {
72787286
result = (std::ostream *) &((Exiv2::Xmpdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
72797287
}

src/swig-0_28_5/exif_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6447,6 +6447,8 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
64476447
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
64486448
}
64496449
{
6450+
PyErr_WarnEx(PyExc_DeprecationWarning,
6451+
"Python scripts should not need to call ""Exiv2::Exifdatum::copy", 1);
64506452
try {
64516453
result = (*arg1)->copy(arg2,arg3);
64526454
}
@@ -6508,6 +6510,8 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_write(PyObject *self, PyObject *arg
65086510
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
65096511
}
65106512
{
6513+
PyErr_WarnEx(PyExc_DeprecationWarning,
6514+
"Python scripts should not need to call ""Exiv2::Exifdatum::write", 1);
65116515
try {
65126516
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
65136517
}
@@ -7988,6 +7992,8 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
79887992
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
79897993
}
79907994
{
7995+
PyErr_WarnEx(PyExc_DeprecationWarning,
7996+
"Python scripts should not need to call ""Exiv2::Exifdatum::copy", 1);
79917997
try {
79927998
result = ((Exiv2::Exifdatum const *)arg1)->copy(arg2,arg3);
79937999
}
@@ -8049,6 +8055,8 @@ SWIGINTERN PyObject *_wrap_Exifdatum_write(PyObject *self, PyObject *args) {
80498055
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
80508056
}
80518057
{
8058+
PyErr_WarnEx(PyExc_DeprecationWarning,
8059+
"Python scripts should not need to call ""Exiv2::Exifdatum::write", 1);
80528060
try {
80538061
result = (std::ostream *) &((Exiv2::Exifdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
80548062
}

src/swig-0_28_5/iptc_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6079,6 +6079,8 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
60796079
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
60806080
}
60816081
{
6082+
PyErr_WarnEx(PyExc_DeprecationWarning,
6083+
"Python scripts should not need to call ""Exiv2::Iptcdatum::copy", 1);
60826084
try {
60836085
result = (*arg1)->copy(arg2,arg3);
60846086
}
@@ -6140,6 +6142,8 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_write(PyObject *self, PyObject *arg
61406142
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
61416143
}
61426144
{
6145+
PyErr_WarnEx(PyExc_DeprecationWarning,
6146+
"Python scripts should not need to call ""Exiv2::Iptcdatum::write", 1);
61436147
try {
61446148
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
61456149
}
@@ -7505,6 +7509,8 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
75057509
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
75067510
}
75077511
{
7512+
PyErr_WarnEx(PyExc_DeprecationWarning,
7513+
"Python scripts should not need to call ""Exiv2::Iptcdatum::copy", 1);
75087514
try {
75097515
result = ((Exiv2::Iptcdatum const *)arg1)->copy(arg2,arg3);
75107516
}
@@ -7566,6 +7572,8 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_write(PyObject *self, PyObject *args) {
75667572
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
75677573
}
75687574
{
7575+
PyErr_WarnEx(PyExc_DeprecationWarning,
7576+
"Python scripts should not need to call ""Exiv2::Iptcdatum::write", 1);
75697577
try {
75707578
result = (std::ostream *) &((Exiv2::Iptcdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
75717579
}

src/swig-0_28_5/metadatum_wrap.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5890,6 +5890,8 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
58905890
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
58915891
}
58925892
{
5893+
PyErr_WarnEx(PyExc_DeprecationWarning,
5894+
"Python scripts should not need to call ""Exiv2::Metadatum::copy", 1);
58935895
try {
58945896
result = ((Exiv2::Metadatum const *)arg1)->copy(arg2,arg3);
58955897
}
@@ -5951,6 +5953,8 @@ SWIGINTERN PyObject *_wrap_Metadatum_write(PyObject *self, PyObject *args) {
59515953
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
59525954
}
59535955
{
5956+
PyErr_WarnEx(PyExc_DeprecationWarning,
5957+
"Python scripts should not need to call ""Exiv2::Metadatum::write", 1);
59545958
try {
59555959
result = (std::ostream *) &((Exiv2::Metadatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
59565960
}

src/swig-0_28_5/xmp_wrap.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6079,6 +6079,8 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_copy(PyObject *self, PyObject *args)
60796079
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
60806080
}
60816081
{
6082+
PyErr_WarnEx(PyExc_DeprecationWarning,
6083+
"Python scripts should not need to call ""Exiv2::Xmpdatum::copy", 1);
60826084
try {
60836085
result = (*arg1)->copy(arg2,arg3);
60846086
}
@@ -6140,6 +6142,8 @@ SWIGINTERN PyObject *_wrap_XmpData_iterator_write(PyObject *self, PyObject *args
61406142
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
61416143
}
61426144
{
6145+
PyErr_WarnEx(PyExc_DeprecationWarning,
6146+
"Python scripts should not need to call ""Exiv2::Xmpdatum::write", 1);
61436147
try {
61446148
result = (std::ostream *) &(*arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
61456149
}
@@ -7447,6 +7451,8 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_copy(PyObject *self, PyObject *args) {
74477451
arg3 = static_cast< Exiv2::ByteOrder >(PyLong_AsLong(obj2));
74487452
}
74497453
{
7454+
PyErr_WarnEx(PyExc_DeprecationWarning,
7455+
"Python scripts should not need to call ""Exiv2::Xmpdatum::copy", 1);
74507456
try {
74517457
result = ((Exiv2::Xmpdatum const *)arg1)->copy(arg2,arg3);
74527458
}
@@ -7508,6 +7514,8 @@ SWIGINTERN PyObject *_wrap_Xmpdatum_write(PyObject *self, PyObject *args) {
75087514
arg3 = reinterpret_cast< Exiv2::ExifData * >(argp3);
75097515
}
75107516
{
7517+
PyErr_WarnEx(PyExc_DeprecationWarning,
7518+
"Python scripts should not need to call ""Exiv2::Xmpdatum::write", 1);
75117519
try {
75127520
result = (std::ostream *) &((Exiv2::Xmpdatum const *)arg1)->write(*arg2,(Exiv2::ExifData const *)arg3);
75137521
}

0 commit comments

Comments
 (0)