From bfbb4f1c48c4ba8b02f75905db3c93af0905a349 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Sep 2023 11:35:35 +0530 Subject: [PATCH] String representation of /Image for debugging --- src/calibre/utils/podofo/images.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/utils/podofo/images.cpp b/src/calibre/utils/podofo/images.cpp index 9fa0d18946..64258265bb 100644 --- a/src/calibre/utils/podofo/images.cpp +++ b/src/calibre/utils/podofo/images.cpp @@ -6,6 +6,8 @@ */ #include "global.h" +#include +#include using namespace pdf; @@ -49,6 +51,10 @@ class Image { } std::size_t hash() const noexcept { return buf.size(); } const PdfReference& reference() const noexcept { return ref; } + std::string ToString() const { + std::hash s; + return "Image(ref=" + ref.ToString() + ", width="s + std::to_string(width) + ", height="s + std::to_string(height) + ", smask="s + smask.ToString() + ", digest=" + std::to_string(s(buf)) + ")"; + } }; struct ImageHasher {