Convert type of depth parameter to size_t.

main
Kevin Backhouse 3 years ago
parent 0f1ea7571b
commit b0040e3bbe
No known key found for this signature in database
GPG Key ID: 9DD01852EE40366E

@ -100,7 +100,7 @@ class EXIV2API BmffImage : public Image {
void readMetadata() override; void readMetadata() override;
void writeMetadata() override; void writeMetadata() override;
void setComment(const std::string& comment) override; void setComment(const std::string& comment) override;
void printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, Exiv2::PrintStructureOption option, size_t depth) override;
//@} //@}
//! @name Accessors //! @name Accessors
@ -122,10 +122,7 @@ class EXIV2API BmffImage : public Image {
@return address of next box @return address of next box
@warning This function should only be called by readMetadata() @warning This function should only be called by readMetadata()
*/ */
uint64_t boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, uint64_t pbox_end, int depth); uint64_t boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, uint64_t pbox_end, size_t depth);
[[nodiscard]] static std::string indent(int i) {
return std::string(2 * i, ' ');
}
uint32_t fileType_{0}; uint32_t fileType_{0};
std::set<size_t> visits_; std::set<size_t> visits_;

@ -56,7 +56,7 @@ class EXIV2API Cr2Image : public Image {
not valid (does not look like data of the specific image type). not valid (does not look like data of the specific image type).
@warning This function is not thread safe and intended for exiv2 -pS for debugging. @warning This function is not thread safe and intended for exiv2 -pS for debugging.
*/ */
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
/*! /*!
@brief Not supported. CR2 format does not contain a comment. @brief Not supported. CR2 format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).

@ -73,7 +73,7 @@ class EXIV2API Image {
@warning This function is not thread safe and intended for exiv2 -pS for debugging. @warning This function is not thread safe and intended for exiv2 -pS for debugging.
@warning You may need to put the stream into binary mode (see src/actions.cpp) @warning You may need to put the stream into binary mode (see src/actions.cpp)
*/ */
virtual void printStructure(std::ostream& out, PrintStructureOption option = kpsNone, int depth = 0); virtual void printStructure(std::ostream& out, PrintStructureOption option = kpsNone, size_t depth = 0);
/*! /*!
@brief Read all metadata supported by a specific image format from the @brief Read all metadata supported by a specific image format from the
image. Before this method is called, the image metadata will be image. Before this method is called, the image metadata will be
@ -293,13 +293,13 @@ class EXIV2API Image {
@throw Error if reading of the file fails or the image data is @throw Error if reading of the file fails or the image data is
not valid (does not look like data of the specific image type). not valid (does not look like data of the specific image type).
*/ */
void printTiffStructure(BasicIo& io, std::ostream& out, PrintStructureOption option, int depth, size_t offset = 0); void printTiffStructure(BasicIo& io, std::ostream& out, PrintStructureOption option, size_t depth, size_t offset = 0);
/*! /*!
@brief Print out the structure of a TIFF IFD @brief Print out the structure of a TIFF IFD
*/ */
void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, size_t start, bool bSwap, void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, size_t start, bool bSwap,
char c, int depth); char c, size_t depth);
/*! /*!
@brief is the host platform bigEndian @brief is the host platform bigEndian

@ -259,7 +259,7 @@ class EXIV2API IptcData {
[[nodiscard]] const char* detectCharset() const; [[nodiscard]] const char* detectCharset() const;
//! @brief dump iptc formatted binary data (used by printStructure kpsRecursive) //! @brief dump iptc formatted binary data (used by printStructure kpsRecursive)
static void printStructure(std::ostream& out, const Slice<byte*>& bytes, uint32_t depth); static void printStructure(std::ostream& out, const Slice<byte*>& bytes, size_t depth);
//@} //@}
private: private:

@ -50,7 +50,7 @@ class EXIV2API Jp2Image : public Image {
not valid (does not look like data of the specific image type). not valid (does not look like data of the specific image type).
@warning This function is not thread safe and intended for exiv2 -pS for debugging. @warning This function is not thread safe and intended for exiv2 -pS for debugging.
*/ */
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
/*! /*!
@brief Todo: Not supported yet(?). Calling this function will throw @brief Todo: Not supported yet(?). Calling this function will throw

@ -24,7 +24,7 @@ class EXIV2API JpegBase : public Image {
//@{ //@{
void readMetadata() override; void readMetadata() override;
void writeMetadata() override; void writeMetadata() override;
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
//@} //@}
~JpegBase() override = default; ~JpegBase() override = default;

@ -52,7 +52,7 @@ class EXIV2API OrfImage : public TiffImage {
//! @name Manipulators //! @name Manipulators
//@{ //@{
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
void readMetadata() override; void readMetadata() override;
void writeMetadata() override; void writeMetadata() override;
/*! /*!

@ -52,7 +52,7 @@ class EXIV2API PngImage : public Image {
not valid (does not look like data of the specific image type). not valid (does not look like data of the specific image type).
@warning This function is not thread safe and intended for exiv2 -pS for debugging. @warning This function is not thread safe and intended for exiv2 -pS for debugging.
*/ */
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
//@} //@}
//! @name Accessors //! @name Accessors

@ -43,7 +43,7 @@ class EXIV2API RafImage : public Image {
//! @name Manipulators //! @name Manipulators
//@{ //@{
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
void readMetadata() override; void readMetadata() override;
/*! /*!
@brief Todo: Write metadata back to the image. This method is not @brief Todo: Write metadata back to the image. This method is not

@ -41,7 +41,7 @@ class EXIV2API Rw2Image : public Image {
//! @name Manipulators //! @name Manipulators
//@{ //@{
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
void readMetadata() override; void readMetadata() override;
/*! /*!
@brief Todo: Write metadata back to the image. This method is not @brief Todo: Write metadata back to the image. This method is not

@ -52,7 +52,7 @@ class EXIV2API TiffImage : public Image {
not valid (does not look like data of the specific image type). not valid (does not look like data of the specific image type).
@warning This function is not thread safe and intended for exiv2 -p{S|R} as a file debugging aid @warning This function is not thread safe and intended for exiv2 -p{S|R} as a file debugging aid
*/ */
void printStructure(std::ostream& out, PrintStructureOption option, int depth = 0) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
/*! /*!
@brief Not supported. TIFF format does not contain a comment. @brief Not supported. TIFF format does not contain a comment.

@ -40,7 +40,7 @@ class EXIV2API WebPImage : public Image {
//@{ //@{
void readMetadata() override; void readMetadata() override;
void writeMetadata() override; void writeMetadata() override;
void printStructure(std::ostream& out, PrintStructureOption option, int depth) override; void printStructure(std::ostream& out, PrintStructureOption option, size_t depth) override;
//@} //@}
/*! /*!

@ -153,7 +153,7 @@ std::string BmffImage::uuidName(Exiv2::DataBuf& uuid) {
} }
uint64_t BmffImage::boxHandler(std::ostream& out /* = std::cout*/, Exiv2::PrintStructureOption option /* = kpsNone */, uint64_t BmffImage::boxHandler(std::ostream& out /* = std::cout*/, Exiv2::PrintStructureOption option /* = kpsNone */,
uint64_t pbox_end, int depth) { uint64_t pbox_end, size_t depth) {
const size_t address = io_->tell(); const size_t address = io_->tell();
// never visit a box twice! // never visit a box twice!
if (depth == 0) if (depth == 0)
@ -184,7 +184,7 @@ uint64_t BmffImage::boxHandler(std::ostream& out /* = std::cout*/, Exiv2::PrintS
if (bTrace) { if (bTrace) {
bLF = true; bLF = true;
out << indent(depth) << "Exiv2::BmffImage::boxHandler: " << toAscii(box_type) out << Internal::indent(depth) << "Exiv2::BmffImage::boxHandler: " << toAscii(box_type)
<< Internal::stringFormat(" %8ld->%" PRIu64 " ", address, box_length); << Internal::stringFormat(" %8ld->%" PRIu64 " ", address, box_length);
} }
@ -299,14 +299,14 @@ uint64_t BmffImage::boxHandler(std::ostream& out /* = std::cout*/, Exiv2::PrintS
if (ilocs_.find(exifID_) != ilocs_.end()) { if (ilocs_.find(exifID_) != ilocs_.end()) {
const Iloc& iloc = ilocs_.find(exifID_)->second; const Iloc& iloc = ilocs_.find(exifID_)->second;
if (bTrace) { if (bTrace) {
out << indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString() << std::endl; out << Internal::indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString() << std::endl;
} }
parseTiff(Internal::Tag::root, iloc.length_, iloc.start_); parseTiff(Internal::Tag::root, iloc.length_, iloc.start_);
} }
if (ilocs_.find(xmpID_) != ilocs_.end()) { if (ilocs_.find(xmpID_) != ilocs_.end()) {
const Iloc& iloc = ilocs_.find(xmpID_)->second; const Iloc& iloc = ilocs_.find(xmpID_)->second;
if (bTrace) { if (bTrace) {
out << indent(depth) << "Exiv2::BMFF XMP: " << iloc.toString() << std::endl; out << Internal::indent(depth) << "Exiv2::BMFF XMP: " << iloc.toString() << std::endl;
} }
parseXmp(iloc.length_, iloc.start_); parseXmp(iloc.length_, iloc.start_);
} }
@ -351,7 +351,7 @@ uint64_t BmffImage::boxHandler(std::ostream& out /* = std::cout*/, Exiv2::PrintS
uint32_t ldata = data.read_uint32(skip + step - 4, endian_); uint32_t ldata = data.read_uint32(skip + step - 4, endian_);
if (bTrace) { if (bTrace) {
out << indent(depth) out << Internal::indent(depth)
<< Internal::stringFormat("%8ld | %8ld | ID | %4u | %6u,%6u", address + skip, step, ID, offset, ldata) << Internal::stringFormat("%8ld | %8ld | ID | %4u | %6u,%6u", address + skip, step, ID, offset, ldata)
<< std::endl; << std::endl;
} }
@ -607,7 +607,7 @@ void BmffImage::readMetadata() {
bReadMetadata_ = true; bReadMetadata_ = true;
} // BmffImage::readMetadata } // BmffImage::readMetadata
void BmffImage::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) { void BmffImage::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, size_t depth) {
if (!bReadMetadata_) if (!bReadMetadata_)
readMetadata(); readMetadata();

@ -42,7 +42,7 @@ uint32_t Cr2Image::pixelHeight() const {
return 0; return 0;
} }
void Cr2Image::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) { void Cr2Image::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, size_t depth) {
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
io_->seek(0, BasicIo::beg); io_->seek(0, BasicIo::beg);

@ -362,8 +362,8 @@ void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList
size_t posPageTrailer = posEndEps; size_t posPageTrailer = posEndEps;
size_t posEof = posEndEps; size_t posEof = posEndEps;
std::vector<std::pair<size_t, size_t>> removableEmbeddings; std::vector<std::pair<size_t, size_t>> removableEmbeddings;
unsigned int depth = 0; size_t depth = 0;
const unsigned int maxDepth = UINT_MAX; const size_t maxDepth = std::numeric_limits<size_t>::max();
bool illustrator8 = false; bool illustrator8 = false;
bool corelDraw = false; bool corelDraw = false;
bool implicitPage = false; bool implicitPage = false;
@ -372,7 +372,7 @@ void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList
bool inDefaultsPreviewPrologSetup = false; bool inDefaultsPreviewPrologSetup = false;
bool inRemovableEmbedding = false; bool inRemovableEmbedding = false;
std::string removableEmbeddingEndLine; std::string removableEmbeddingEndLine;
unsigned int removableEmbeddingsWithUnmarkedTrailer = 0; size_t removableEmbeddingsWithUnmarkedTrailer = 0;
for (size_t pos = posEps; pos < posEof;) { for (size_t pos = posEps; pos < posEof;) {
const size_t startPos = pos; const size_t startPos = pos;
std::string line; std::string line;

@ -123,7 +123,7 @@ Image::Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io)
#endif #endif
} }
void Image::printStructure(std::ostream&, PrintStructureOption, int /*depth*/) { void Image::printStructure(std::ostream&, PrintStructureOption, size_t /*depth*/) {
throw Error(ErrorCode::kerUnsupportedImageType, io_->path()); throw Error(ErrorCode::kerUnsupportedImageType, io_->path());
} }
@ -284,7 +284,7 @@ static bool typeValid(uint16_t type) {
static std::set<size_t> visits; // #547 static std::set<size_t> visits; // #547
void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, size_t start, void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, size_t start,
bool bSwap, char c, int depth) { bool bSwap, char c, size_t depth) {
if (depth == 1) if (depth == 1)
visits.clear(); visits.clear();
bool bFirst = true; bool bFirst = true;
@ -405,7 +405,7 @@ void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStruct
for (size_t k = 0; k < count; k++) { for (size_t k = 0; k < count; k++) {
const size_t restore = io.tell(); const size_t restore = io.tell();
offset = byteSwap4(buf, k * size, bSwap); offset = byteSwap4(buf, k * size, bSwap);
printIFDStructure(io, out, option, offset, bSwap, c, depth+1); printIFDStructure(io, out, option, offset, bSwap, c, depth + 1);
io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata); io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata);
} }
} else if (option == kpsRecursive && tag == 0x83bb /* IPTCNAA */) { } else if (option == kpsRecursive && tag == 0x83bb /* IPTCNAA */) {
@ -442,12 +442,12 @@ void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStruct
DataBuf bytes(byteslen); // allocate a buffer DataBuf bytes(byteslen); // allocate a buffer
io.readOrThrow(bytes.data(), byteslen, ErrorCode::kerCorruptedMetadata); // read io.readOrThrow(bytes.data(), byteslen, ErrorCode::kerCorruptedMetadata); // read
MemIo memIo(bytes.c_data(), byteslen); // create a file MemIo memIo(bytes.c_data(), byteslen); // create a file
printTiffStructure(memIo, out, option, depth+1); printTiffStructure(memIo, out, option, depth + 1);
} else { } else {
// tag is an IFD // tag is an IFD
uint32_t punt = bSony ? 12 : 0; uint32_t punt = bSony ? 12 : 0;
io.seekOrThrow(0, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // position io.seekOrThrow(0, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // position
printIFDStructure(io, out, option, offset + punt, bSwap, c, depth+1); printIFDStructure(io, out, option, offset + punt, bSwap, c, depth + 1);
} }
io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // restore io.seekOrThrow(restore, BasicIo::beg, ErrorCode::kerCorruptedMetadata); // restore
@ -474,7 +474,7 @@ void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStruct
out.flush(); out.flush();
} }
void Image::printTiffStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, int depth, void Image::printTiffStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, size_t depth,
size_t offset /*=0*/) { size_t offset /*=0*/) {
if (option == kpsBasic || option == kpsXMP || option == kpsRecursive || option == kpsIccProfile) { if (option == kpsBasic || option == kpsXMP || option == kpsRecursive || option == kpsIccProfile) {
// buffer // buffer

@ -35,12 +35,8 @@ std::string stringFormat(const char* format, ...) {
return result; return result;
} }
std::string indent(int32_t d) { [[nodiscard]] std::string indent(size_t i) {
std::string result; return std::string(2 * i, ' ');
if (d > 0)
while (d--)
result += " ";
return result;
} }
} // namespace Exiv2::Internal } // namespace Exiv2::Internal

@ -98,7 +98,7 @@ inline binaryToStringHelper<T> binaryToString(const Slice<T> sl) noexcept {
} }
/// @brief indent output for kpsRecursive in \em printStructure() \em . /// @brief indent output for kpsRecursive in \em printStructure() \em .
std::string indent(int32_t depth); std::string indent(size_t depth);
} // namespace Exiv2::Internal } // namespace Exiv2::Internal

@ -275,7 +275,7 @@ IptcData::iterator IptcData::erase(IptcData::iterator pos) {
return iptcMetadata_.erase(pos); return iptcMetadata_.erase(pos);
} }
void IptcData::printStructure(std::ostream& out, const Slice<byte*>& bytes, uint32_t depth) { void IptcData::printStructure(std::ostream& out, const Slice<byte*>& bytes, size_t depth) {
if (bytes.size() < 3) { if (bytes.size() < 3) {
return; return;
} }

@ -388,7 +388,7 @@ void Jp2Image::readMetadata() {
} // Jp2Image::readMetadata } // Jp2Image::readMetadata
void Jp2Image::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void Jp2Image::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
@ -553,7 +553,7 @@ void Jp2Image::printStructure(std::ostream& out, PrintStructureOption option, in
const char b = rawData.read_uint8(1); const char b = rawData.read_uint8(1);
if (a == b && (a == 'I' || a == 'M')) { if (a == b && (a == 'I' || a == 'M')) {
MemIo p(rawData.c_data(), rawData.size()); MemIo p(rawData.c_data(), rawData.size());
printTiffStructure(p, out, option, depth+1); printTiffStructure(p, out, option, depth + 1);
} }
} }

@ -293,7 +293,7 @@ void JpegBase::readMetadata() {
if ((option == kpsBasic || option == kpsRecursive)) \ if ((option == kpsBasic || option == kpsRecursive)) \
out << Internal::stringFormat("%8ld | 0xff%02x %-5s", io_->tell() - 2, marker, nm[marker].c_str()) out << Internal::stringFormat("%8ld | 0xff%02x %-5s", io_->tell() - 2, marker, nm[marker].c_str())
void JpegBase::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void JpegBase::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
// Ensure that this is the correct image type // Ensure that this is the correct image type
@ -485,7 +485,7 @@ void JpegBase::printStructure(std::ostream& out, PrintStructureOption option, in
if (start < max) { if (start < max) {
// create a copy on write memio object with the data, then print the structure // create a copy on write memio object with the data, then print the structure
MemIo p(buf.c_data(start), size - start); MemIo p(buf.c_data(start), size - start);
printTiffStructure(p, out, option, depth+1); printTiffStructure(p, out, option, depth + 1);
} }
} }

@ -51,7 +51,7 @@ void OrfImage::setComment(const std::string&) {
throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "ORF")); throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "ORF"));
} }
void OrfImage::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void OrfImage::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
out << "ORF IMAGE" << std::endl; out << "ORF IMAGE" << std::endl;
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());

@ -178,7 +178,7 @@ std::string::size_type findi(const std::string& str, const std::string& substr)
return str.find(substr); return str.find(substr);
} }
void PngImage::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void PngImage::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
if (io_->open() != 0) { if (io_->open() != 0) {
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
} }
@ -330,7 +330,7 @@ void PngImage::printStructure(std::ostream& out, PrintStructureOption option, in
if (bExif) { if (bExif) {
// create memio object with the data, then print the structure // create memio object with the data, then print the structure
MemIo p(parsedBuf.c_data(6), parsedBuf.size() - 6); MemIo p(parsedBuf.c_data(6), parsedBuf.size() - 6);
printTiffStructure(p, out, option, depth+1); printTiffStructure(p, out, option, depth + 1);
} }
if (bIptc) { if (bIptc) {
IptcData::printStructure(out, makeSlice(parsedBuf, 0, parsedBuf.size()), depth); IptcData::printStructure(out, makeSlice(parsedBuf, 0, parsedBuf.size()), depth);
@ -361,7 +361,7 @@ void PngImage::printStructure(std::ostream& out, PrintStructureOption option, in
if (eXIf && option == kpsRecursive) { if (eXIf && option == kpsRecursive) {
// create memio object with the data, then print the structure // create memio object with the data, then print the structure
MemIo p(data.c_data(), dataOffset); MemIo p(data.c_data(), dataOffset);
printTiffStructure(p, out, option, depth+1); printTiffStructure(p, out, option, depth + 1);
} }
if (bLF) if (bLF)

@ -57,7 +57,7 @@ void RafImage::setComment(const std::string&) {
throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RAF")); throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RAF"));
} }
void RafImage::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void RafImage::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
if (io_->open() != 0) { if (io_->open() != 0) {
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
} }

@ -61,7 +61,7 @@ void Rw2Image::setComment(const std::string&) {
throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RW2")); throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RW2"));
} }
void Rw2Image::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void Rw2Image::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
out << "RW2 IMAGE" << std::endl; out << "RW2 IMAGE" << std::endl;
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());

@ -262,7 +262,7 @@ bool isTiffType(BasicIo& iIo, bool advance) {
return rc; return rc;
} }
void TiffImage::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) { void TiffImage::printStructure(std::ostream& out, Exiv2::PrintStructureOption option, size_t depth) {
if (io_->open() != 0) if (io_->open() != 0)
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
// Ensure that this is the correct image type // Ensure that this is the correct image type

@ -407,7 +407,7 @@ void WebPImage::doWriteMetadata(BasicIo& outIo) {
/* =========================================== */ /* =========================================== */
void WebPImage::printStructure(std::ostream& out, PrintStructureOption option, int depth) { void WebPImage::printStructure(std::ostream& out, PrintStructureOption option, size_t depth) {
if (io_->open() != 0) { if (io_->open() != 0) {
throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError());
} }
@ -450,7 +450,7 @@ void WebPImage::printStructure(std::ostream& out, PrintStructureOption option, i
if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF) && option == kpsRecursive) { if (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_EXIF) && option == kpsRecursive) {
// create memio object with the payload, then print the structure // create memio object with the payload, then print the structure
MemIo p(payload.c_data(), payload.size()); MemIo p(payload.c_data(), payload.size());
printTiffStructure(p, out, option, depth+1); printTiffStructure(p, out, option, depth + 1);
} }
bool bPrintPayload = (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP) && option == kpsXMP) || bool bPrintPayload = (equalsWebPTag(chunkId, WEBP_CHUNK_HEADER_XMP) && option == kpsXMP) ||

Loading…
Cancel
Save