* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <config.h>
-
-#if HAVE_EXIV2
-
#include "exif.h"
#include <algorithm>
#include <utility>
#include <vector>
+#include <config.h>
+
#include <exiv2/exiv2.hpp>
#include <glib.h>
#ifdef ENABLE_NLS
copyXmpToExif(xmpData_, exifData_);
Exiv2::Image *image = imageData_->image();
+ if (!image)
#ifdef HAVE_EXIV2_ERROR_CODE
-#if EXIV2_TEST_VERSION(0,28,0)
- if (!image) throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
+# if EXIV2_TEST_VERSION(0,28,0)
+ throw Exiv2::Error(Exiv2::ErrorCode::kerInputDataReadFailed);
+# else
+ throw Exiv2::Error(Exiv2::kerInputDataReadFailed);
+# endif
#else
- if (!image) throw Exiv2::Error(Exiv2::kerInputDataReadFailed);
-#endif
-#else
- if (!image) throw Exiv2::Error(21);
+ throw Exiv2::Error(21);
#endif
image->setExifData(exifData_);
image->setIptcData(iptcData_);
auto md = reinterpret_cast<Exiv2::Metadatum *>(item);
if (data_len) *data_len = md->size();
auto data = static_cast<char *>(g_malloc(md->size()));
- long res = md->copy(reinterpret_cast<Exiv2::byte *>(data), Exiv2::littleEndian /* should not matter */);
+ auto res = md->copy(reinterpret_cast<Exiv2::byte *>(data), Exiv2::littleEndian /* should not matter */);
g_assert(res == md->size());
return data;
}
else
{
/* read as a list */
- gint i;
+#if EXIV2_TEST_VERSION(0,28,0)
+ size_t i;
+#else
+ long i;
+#endif
for (i = 0; i < item.count(); i++)
list = g_list_append(list, utf8_validate_or_convert(item.toString(i).c_str()));
}
delete[] static_cast<const Exiv2::byte*>(buf);
}
-#endif /* HAVE_EXIV2 */
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */