Merge pull request #1956 from kevinbackhouse/DataBufMoveCnstr

Use std::move to transfer ownership of DataBufs.
main
Kevin Backhouse 4 years ago committed by GitHub
commit aaf5843f6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -222,7 +222,7 @@ namespace Exiv2 {
@param iccProfile DataBuf containing profile (binary) @param iccProfile DataBuf containing profile (binary)
@param bTestValid - tests that iccProfile contains credible data @param bTestValid - tests that iccProfile contains credible data
*/ */
virtual void setIccProfile(DataBuf& iccProfile,bool bTestValid=true); virtual void setIccProfile(DataBuf&& iccProfile,bool bTestValid=true);
/*! /*!
@brief Erase iccProfile. the profile is not removed from @brief Erase iccProfile. the profile is not removed from
the actual image until the writeMetadata() method is called. the actual image until the writeMetadata() method is called.
@ -240,7 +240,8 @@ namespace Exiv2 {
/*! /*!
@brief return iccProfile @brief return iccProfile
*/ */
virtual DataBuf* iccProfile() { return &iccProfile_; } virtual const DataBuf& iccProfile() const { return iccProfile_; }
/*! /*!
@brief Copy all existing metadata from source Image. The data is @brief Copy all existing metadata from source Image. The data is
copied into internal buffers and is not written to the image copied into internal buffers and is not written to the image

@ -145,7 +145,7 @@ namespace Exiv2 {
private: private:
//! Private constructor //! Private constructor
PreviewImage(PreviewProperties properties, DataBuf data); PreviewImage(PreviewProperties properties, DataBuf&& data);
PreviewProperties properties_; //!< Preview image properties PreviewProperties properties_; //!< Preview image properties
DataBuf preview_; //!< Preview image data DataBuf preview_; //!< Preview image data

@ -153,18 +153,6 @@ namespace Exiv2 {
}; };
/*!
@brief Auxiliary type to enable copies and assignments, similar to
std::unique_ptr_ref. See http://www.josuttis.com/libbook/auto_ptr.html
for a discussion.
*/
struct EXIV2API DataBufRef {
//! Constructor
explicit DataBufRef(std::pair<byte*, long> rhs) : p(rhs) {}
//! Pointer to a byte array and its size
std::pair<byte*, long> p;
};
/*! /*!
@brief Utility class containing a character array. All it does is to take @brief Utility class containing a character array. All it does is to take
care of memory allocation and deletion. Its primary use is meant to care of memory allocation and deletion. Its primary use is meant to
@ -181,11 +169,15 @@ namespace Exiv2 {
//! Constructor, copies an existing buffer //! Constructor, copies an existing buffer
DataBuf(const byte* pData, long size); DataBuf(const byte* pData, long size);
/*! /*!
@brief Copy constructor. Transfers the buffer to the newly created @brief Copy constructor. Copies an existing DataBuf.
*/
DataBuf(const DataBuf& rhs);
/*!
@brief Move constructor. Transfers the buffer to the newly created
object similar to std::unique_ptr, i.e., the original object is object similar to std::unique_ptr, i.e., the original object is
modified. modified.
*/ */
DataBuf(DataBuf& rhs); DataBuf(DataBuf&& rhs);
//! Destructor, deletes the allocated buffer //! Destructor, deletes the allocated buffer
~DataBuf(); ~DataBuf();
//@} //@}
@ -197,7 +189,11 @@ namespace Exiv2 {
buffer at the original object similar to std::unique_ptr, i.e., buffer at the original object similar to std::unique_ptr, i.e.,
the original object is modified. the original object is modified.
*/ */
DataBuf& operator=(DataBuf& rhs); DataBuf& operator=(DataBuf&& rhs);
// No copy assignment.
DataBuf& operator=(const DataBuf&) = delete;
/*! /*!
@brief Allocate a data buffer of at least the given size. Note that if @brief Allocate a data buffer of at least the given size. Note that if
the requested \em size is less than the current buffer size, no the requested \em size is less than the current buffer size, no
@ -208,6 +204,7 @@ namespace Exiv2 {
@brief Resize the buffer. Existing data is preserved (like std::realloc()). @brief Resize the buffer. Existing data is preserved (like std::realloc()).
*/ */
void resize(long size); void resize(long size);
/*! /*!
@brief Release ownership of the buffer to the caller. Returns the @brief Release ownership of the buffer to the caller. Returns the
buffer as a data pointer and size pair, resets the internal buffer as a data pointer and size pair, resets the internal
@ -216,25 +213,12 @@ namespace Exiv2 {
EXV_WARN_UNUSED_RESULT std::pair<byte*, long> release(); EXV_WARN_UNUSED_RESULT std::pair<byte*, long> release();
//! Reset value //! Reset value
void reset(std::pair<byte*, long> = {nullptr, long(0)}); void reset();
//@} //@}
//! Fill the buffer with zeros. //! Fill the buffer with zeros.
void clear(); void clear();
/*!
@name Conversions
Special conversions with auxiliary type to enable copies
and assignments, similar to those used for std::unique_ptr.
See http://www.josuttis.com/libbook/auto_ptr.html for a discussion.
*/
//@{
DataBuf(const DataBufRef& rhs);
DataBuf& operator=(DataBufRef rhs);
operator DataBufRef();
//@}
long size() const { return size_; } long size() const { return size_; }
uint8_t read_uint8(size_t offset) const; uint8_t read_uint8(size_t offset) const;

@ -1025,15 +1025,15 @@ namespace Action {
} else { } else {
if ( bStdout ) { // -eC- if ( bStdout ) { // -eC-
std::cout.write(image->iccProfile()->c_str(), std::cout.write(image->iccProfile().c_str(),
image->iccProfile()->size()); image->iccProfile().size());
} else { } else {
if (Params::instance().verbose_) { if (Params::instance().verbose_) {
std::cout << _("Writing iccProfile: ") << target << std::endl; std::cout << _("Writing iccProfile: ") << target << std::endl;
} }
Exiv2::FileIo iccFile(target); Exiv2::FileIo iccFile(target);
iccFile.open("wb") ; iccFile.open("wb") ;
iccFile.write(image->iccProfile()->c_data(),image->iccProfile()->size()); iccFile.write(image->iccProfile().c_data(),image->iccProfile().size());
iccFile.close(); iccFile.close();
} }
} }
@ -1180,7 +1180,7 @@ namespace Action {
if ( iccPath == "-" ) { if ( iccPath == "-" ) {
Exiv2::DataBuf iccProfile ; Exiv2::DataBuf iccProfile ;
Params::instance().getStdin(iccProfile); Params::instance().getStdin(iccProfile);
rc = insertIccProfile(path,iccProfile); rc = insertIccProfile(path,std::move(iccProfile));
} else { } else {
if (!Exiv2::fileExists(iccProfilePath, true)) { if (!Exiv2::fileExists(iccProfilePath, true)) {
std::cerr << iccProfilePath std::cerr << iccProfilePath
@ -1188,13 +1188,13 @@ namespace Action {
rc = -1; rc = -1;
} else { } else {
Exiv2::DataBuf iccProfile = Exiv2::readFile(iccPath); Exiv2::DataBuf iccProfile = Exiv2::readFile(iccPath);
rc = insertIccProfile(path,iccProfile); rc = insertIccProfile(path,std::move(iccProfile));
} }
} }
return rc; return rc;
} // Insert::insertIccProfile } // Insert::insertIccProfile
int Insert::insertIccProfile(const std::string& path, Exiv2::DataBuf& iccProfileBlob) int Insert::insertIccProfile(const std::string& path, Exiv2::DataBuf&& iccProfileBlob)
{ {
int rc = 0; int rc = 0;
// test path exists // test path exists
@ -1211,7 +1211,7 @@ namespace Action {
// clear existing profile, assign the blob and rewrite image // clear existing profile, assign the blob and rewrite image
image->clearIccProfile(); image->clearIccProfile();
if ( iccProfileBlob.size() ) { if ( iccProfileBlob.size() ) {
image->setIccProfile(iccProfileBlob); image->setIccProfile(std::move(iccProfileBlob));
} }
image->writeMetadata(); image->writeMetadata();
} }

@ -360,7 +360,7 @@ namespace Action {
/*! /*!
@brief Insert an ICC profile from binary DataBuf into file \em path. @brief Insert an ICC profile from binary DataBuf into file \em path.
*/ */
static int insertIccProfile(const std::string& path, Exiv2::DataBuf& iccProfileBlob); static int insertIccProfile(const std::string& path, Exiv2::DataBuf&& iccProfileBlob);
private: private:
Insert* clone_() const override; Insert* clone_() const override;

@ -411,12 +411,12 @@ namespace Exiv2
skip+=4; skip+=4;
if ( colour_type == "rICC" || colour_type == "prof" ) { if ( colour_type == "rICC" || colour_type == "prof" ) {
DataBuf profile(data.c_data(skip),data.size()-skip); DataBuf profile(data.c_data(skip),data.size()-skip);
setIccProfile(profile); setIccProfile(std::move(profile));
} else if ( meth == 2 && prec == 0 && approx == 0 ) { } else if ( meth == 2 && prec == 0 && approx == 0 ) {
// JP2000 files have a 3 byte head // 2 0 0 icc...... // JP2000 files have a 3 byte head // 2 0 0 icc......
skip -= 1 ; skip -= 1 ;
DataBuf profile(data.c_data(skip),data.size()-skip); DataBuf profile(data.c_data(skip),data.size()-skip);
setIccProfile(profile); setIccProfile(std::move(profile));
} }
} }
} break; } break;

@ -553,9 +553,9 @@ namespace Exiv2 {
} }
} // CiffDirectory::doPrint } // CiffDirectory::doPrint
void CiffComponent::setValue(DataBuf buf) void CiffComponent::setValue(DataBuf&& buf)
{ {
storage_ = buf; storage_ = std::move(buf);
pData_ = storage_.c_data(); pData_ = storage_.c_data();
size_ = storage_.size(); size_ = storage_.size();
if (size_ > 8 && dataLocation() == directoryData) { if (size_ > 8 && dataLocation() == directoryData) {
@ -626,7 +626,7 @@ namespace Exiv2 {
return nullptr; return nullptr;
} // CiffDirectory::doFindComponent } // CiffDirectory::doFindComponent
void CiffHeader::add(uint16_t crwTagId, uint16_t crwDir, DataBuf buf) void CiffHeader::add(uint16_t crwTagId, uint16_t crwDir, DataBuf&& buf)
{ {
CrwDirs crwDirs; CrwDirs crwDirs;
CrwMap::loadStack(crwDirs, crwDir); CrwMap::loadStack(crwDirs, crwDir);
@ -639,7 +639,7 @@ namespace Exiv2 {
} }
CiffComponent* child = pRootDir_->add(crwDirs, crwTagId); CiffComponent* child = pRootDir_->add(crwDirs, crwTagId);
if (child) { if (child) {
child->setValue(buf); child->setValue(std::move(buf));
} }
} // CiffHeader::add } // CiffHeader::add
@ -1015,7 +1015,7 @@ namespace Exiv2 {
if (ed != image.exifData().end()) { if (ed != image.exifData().end()) {
DataBuf buf(ed->size()); DataBuf buf(ed->size());
ed->copy(buf.data(), pHead->byteOrder()); ed->copy(buf.data(), pHead->byteOrder());
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
@ -1039,14 +1039,14 @@ namespace Exiv2 {
DataBuf buf(size); DataBuf buf(size);
buf.clear(); buf.clear();
buf.copyBytes(0, comment.data(), comment.size()); buf.copyBytes(0, comment.data(), comment.size());
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
if (cc) { if (cc) {
// Just delete the value, do not remove the tag // Just delete the value, do not remove the tag
DataBuf buf(cc->size()); DataBuf buf(cc->size());
buf.clear(); buf.clear();
cc->setValue(buf); cc->setValue(std::move(buf));
} }
} }
} // CrwMap::encode0x0805 } // CrwMap::encode0x0805
@ -1079,7 +1079,7 @@ namespace Exiv2 {
pos += ed2->size(); pos += ed2->size();
} }
assert(pos == size); assert(pos == size);
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
@ -1109,7 +1109,7 @@ namespace Exiv2 {
if (buf.size() > 0) { if (buf.size() > 0) {
// Write the number of shorts to the beginning of buf // Write the number of shorts to the beginning of buf
buf.write_uint16(0, static_cast<uint16_t>(buf.size()), pHead->byteOrder()); buf.write_uint16(0, static_cast<uint16_t>(buf.size()), pHead->byteOrder());
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
@ -1137,7 +1137,7 @@ namespace Exiv2 {
DataBuf buf(12); DataBuf buf(12);
buf.clear(); buf.clear();
buf.write_uint32(0, static_cast<uint32_t>(t), pHead->byteOrder()); buf.write_uint32(0, static_cast<uint32_t>(t), pHead->byteOrder());
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
@ -1183,7 +1183,7 @@ namespace Exiv2 {
d = RotationMap::degrees(static_cast<uint16_t>(edO->toLong())); d = RotationMap::degrees(static_cast<uint16_t>(edO->toLong()));
} }
buf.write_uint32(12, d, pHead->byteOrder()); buf.write_uint32(12, d, pHead->byteOrder());
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);
@ -1200,7 +1200,7 @@ namespace Exiv2 {
ExifThumbC exifThumb(image.exifData()); ExifThumbC exifThumb(image.exifData());
DataBuf buf = exifThumb.copy(); DataBuf buf = exifThumb.copy();
if (buf.size() != 0) { if (buf.size() != 0) {
pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, buf); pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf));
} }
else { else {
pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_);

@ -164,7 +164,7 @@ namespace Exiv2 {
//! Set the directory tag for this component. //! Set the directory tag for this component.
void setDir(uint16_t dir) { dir_ = dir; } void setDir(uint16_t dir) { dir_ = dir; }
//! Set the data value of the entry. //! Set the data value of the entry.
void setValue(DataBuf buf); void setValue(DataBuf&& buf);
//@} //@}
//! Return the type id for a tag //! Return the type id for a tag
@ -446,7 +446,7 @@ namespace Exiv2 {
@param crwDir Parent directory of the tag. @param crwDir Parent directory of the tag.
@param buf Value to be set. @param buf Value to be set.
*/ */
void add(uint16_t crwTagId, uint16_t crwDir, DataBuf buf); void add(uint16_t crwTagId, uint16_t crwDir, DataBuf&& buf);
/*! /*!
@brief Remove entry \em crwTagId in directory \em crwDir from the parse @brief Remove entry \em crwTagId in directory \em crwDir from the parse
tree. If it's the last entry in the directory, the directory is tree. If it's the last entry in the directory, the directory is

@ -590,8 +590,8 @@ namespace Exiv2 {
if (checkMode(mdIptc) & amWrite) { if (checkMode(mdIptc) & amWrite) {
setIptcData(image.iptcData()); setIptcData(image.iptcData());
} }
if (checkMode(mdIccProfile) & amWrite && iccProfile()) { if (checkMode(mdIccProfile) & amWrite) {
setIccProfile(*iccProfile()); setIccProfile(DataBuf(image.iccProfile()));
} }
if (checkMode(mdXmp) & amWrite) { if (checkMode(mdXmp) & amWrite) {
setXmpPacket(image.xmpPacket()); setXmpPacket(image.xmpPacket());
@ -668,7 +668,7 @@ namespace Exiv2 {
comment_ = comment; comment_ = comment;
} }
void Image::setIccProfile(Exiv2::DataBuf& iccProfile,bool bTestValid) void Image::setIccProfile(Exiv2::DataBuf&& iccProfile,bool bTestValid)
{ {
if ( bTestValid ) { if ( bTestValid ) {
if (iccProfile.size() < static_cast<long>(sizeof(long))) { if (iccProfile.size() < static_cast<long>(sizeof(long))) {
@ -679,7 +679,7 @@ namespace Exiv2 {
throw Error(kerInvalidIccProfile); throw Error(kerInvalidIccProfile);
} }
} }
iccProfile_ = iccProfile; iccProfile_ = std::move(iccProfile);
} }
void Image::clearIccProfile() void Image::clearIccProfile()

@ -303,7 +303,7 @@ static void boxes_check(size_t b,size_t m)
} }
std::cout << "Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size() << " bytes to " << iccPath << std::endl ; std::cout << "Exiv2::Jp2Image::readMetadata: wrote iccProfile " << icc.size() << " bytes to " << iccPath << std::endl ;
#endif #endif
setIccProfile(icc); setIccProfile(std::move(icc));
} }
if( subBox.type == kJp2BoxTypeImageHeader) if( subBox.type == kJp2BoxTypeImageHeader)

@ -496,7 +496,7 @@ namespace Exiv2 {
profile.copyBytes(0, iccProfile_.c_data(), iccProfile_.size()); profile.copyBytes(0, iccProfile_.c_data(), iccProfile_.size());
} }
profile.copyBytes(iccProfile_.size(), buf.c_data(2+14), icc_size); profile.copyBytes(iccProfile_.size(), buf.c_data(2+14), icc_size);
setIccProfile(profile,chunk==chunks); setIccProfile(std::move(profile),chunk==chunks);
} }
else if ( pixelHeight_ == 0 && inRange2(marker,sof0_,sof3_,sof5_,sof15_) ) { else if ( pixelHeight_ == 0 && inRange2(marker,sof0_,sof3_,sof5_,sof15_) ) {
// We hit a SOFn (start-of-frame) marker // We hit a SOFn (start-of-frame) marker

@ -1037,8 +1037,8 @@ namespace {
// ***************************************************************************** // *****************************************************************************
// class member definitions // class member definitions
namespace Exiv2 { namespace Exiv2 {
PreviewImage::PreviewImage(PreviewProperties properties, DataBuf data) PreviewImage::PreviewImage(PreviewProperties properties, DataBuf&& data)
: properties_(std::move(properties)), preview_(data) : properties_(std::move(properties)), preview_(std::move(data))
{} {}
PreviewImage::PreviewImage(const PreviewImage &rhs) PreviewImage::PreviewImage(const PreviewImage &rhs)
@ -1148,6 +1148,6 @@ namespace Exiv2 {
buf = loader->getData(); buf = loader->getData();
} }
return PreviewImage(properties, buf); return PreviewImage(properties, std::move(buf));
} }
} // namespace Exiv2 } // namespace Exiv2

@ -627,7 +627,7 @@ namespace Exiv2 {
buf.copyBytes(0, rawIptc.c_data(), rawIptc.size()); buf.copyBytes(0, rawIptc.c_data(), rawIptc.size());
} }
else { else {
buf = rawIptc; // Note: This resets rawIptc buf = std::move(rawIptc); // Note: This resets rawIptc
} }
value->read(buf.data(), buf.size(), byteOrder_); value->read(buf.data(), buf.size(), byteOrder_);
Exifdatum iptcDatum(iptcNaaKey, value.get()); Exifdatum iptcDatum(iptcNaaKey, value.get());
@ -1654,7 +1654,7 @@ namespace Exiv2 {
const byte* pData = object->pData(); const byte* pData = object->pData();
int32_t size = object->TiffEntryBase::doSize(); int32_t size = object->TiffEntryBase::doSize();
DataBuf buf = cryptFct(object->tag(), pData, size, pRoot_); DataBuf buf = cryptFct(object->tag(), pData, size, pRoot_);
if (buf.size() > 0) object->setData(buf); if (buf.size() > 0) object->setData(std::move(buf));
} }
const ArrayDef* defs = object->def(); const ArrayDef* defs = object->def();

@ -121,11 +121,11 @@ namespace Exiv2 {
return tit->size_; return tit->size_;
} }
DataBuf::DataBuf(DataBuf& rhs) DataBuf::DataBuf(DataBuf&& rhs)
: pData_(rhs.pData_), size_(rhs.size_) : pData_(rhs.pData_), size_(rhs.size_)
{ {
std::pair<byte*, long> ret = rhs.release(); rhs.pData_ = nullptr;
UNUSED(ret); rhs.size_ = 0;
} }
DataBuf::~DataBuf() DataBuf::~DataBuf()
@ -146,10 +146,16 @@ namespace Exiv2 {
} }
} }
DataBuf& DataBuf::operator=(DataBuf& rhs) DataBuf::DataBuf(const DataBuf& rhs)
: DataBuf(rhs.pData_, rhs.size_)
{}
DataBuf& DataBuf::operator=(DataBuf&& rhs)
{ {
if (this == &rhs) return *this; if (this == &rhs) return *this;
reset(rhs.release()); reset();
std::swap(pData_, rhs.pData_);
std::swap(size_, rhs.size_);
return *this; return *this;
} }
@ -185,25 +191,17 @@ namespace Exiv2 {
return p; return p;
} }
void DataBuf::reset(std::pair<byte*, long> p) void DataBuf::reset()
{ {
if (pData_ != p.first) { delete[] pData_;
delete[] pData_; pData_ = nullptr;
pData_ = p.first; size_ = 0;
}
size_ = p.second;
} }
void DataBuf::clear() { void DataBuf::clear() {
memset(pData_, 0, size_); memset(pData_, 0, size_);
} }
DataBuf::DataBuf(const DataBufRef &rhs) : pData_(rhs.p.first), size_(rhs.p.second) {}
DataBuf &DataBuf::operator=(DataBufRef rhs) { reset(rhs.p); return *this; }
Exiv2::DataBuf::operator DataBufRef() { return DataBufRef(release()); }
uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const { uint8_t Exiv2::DataBuf::read_uint8(size_t offset) const {
if (offset >= static_cast<size_t>(size_)) { if (offset >= static_cast<size_t>(size_)) {
throw std::overflow_error("Overflow in Exiv2::DataBuf::read_uint8"); throw std::overflow_error("Overflow in Exiv2::DataBuf::read_uint8");

@ -635,7 +635,7 @@ namespace Exiv2 {
pixelHeight_ = Exiv2::getULong(size_buf, littleEndian) + 1; pixelHeight_ = Exiv2::getULong(size_buf, littleEndian) + 1;
} else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) { } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_ICCP)) {
readOrThrow(*io_, payload.data(), payload.size(), Exiv2::kerCorruptedMetadata); readOrThrow(*io_, payload.data(), payload.size(), Exiv2::kerCorruptedMetadata);
this->setIccProfile(payload); this->setIccProfile(std::move(payload));
} else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) { } else if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF)) {
readOrThrow(*io_, payload.data(), payload.size(), Exiv2::kerCorruptedMetadata); readOrThrow(*io_, payload.data(), payload.size(), Exiv2::kerCorruptedMetadata);

Loading…
Cancel
Save