diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp index bb4e4698..5b47ea58 100644 --- a/include/exiv2/image.hpp +++ b/include/exiv2/image.hpp @@ -479,9 +479,13 @@ class EXIV2API Image { private: // DATA - ImageType imageType_; //!< Image type - uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types - bool writeXmpFromPacket_; //!< Determines the source when writing XMP + ImageType imageType_; //!< Image type + uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types +#ifdef EXV_HAVE_XMP_TOOLKIT + bool writeXmpFromPacket_{false}; //!< Determines the source when writing XMP +#else + bool writeXmpFromPacket_{true}; //!< Determines the source when writing XMP +#endif ByteOrder byteOrder_{invalidByteOrder}; //!< Byte order std::map tags_; //!< Map of tags diff --git a/src/image.cpp b/src/image.cpp index 6f648a9d..1a30d866 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -128,14 +128,7 @@ std::string pathOfFileUrl(const std::string& url) { // class member definitions namespace Exiv2 { Image::Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io) : - io_(std::move(io)), - imageType_(type), - supportedMetadata_(supportedMetadata), -#ifdef EXV_HAVE_XMP_TOOLKIT - writeXmpFromPacket_(false) { -#else - writeXmpFromPacket_(true) { -#endif + io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) { } void Image::printStructure(std::ostream&, PrintStructureOption, size_t /*depth*/) {