diff --git a/src/calibre/utils/podofo/images.cpp b/src/calibre/utils/podofo/images.cpp index 6e9b6029f9..1ee3aa66c4 100644 --- a/src/calibre/utils/podofo/images.cpp +++ b/src/calibre/utils/podofo/images.cpp @@ -13,9 +13,11 @@ class Image { charbuff buf; int64_t width, height; PdfReference ref; + PdfReference smask; + bool is_valid; + Image( const Image & ) ; Image & operator=( const Image & ) ; - bool is_valid; public: Image(const PdfReference &reference, const PdfObject *o) : buf(), width(0), height(0), ref(reference) { @@ -30,18 +32,20 @@ class Image { const PdfDictionary &dict = o->GetDictionary(); if (dict.HasKey("Width") && dict.GetKey("Width")->IsNumber()) width = dict.GetKey("Width")->GetNumber(); if (dict.HasKey("Height") && dict.GetKey("Height")->IsNumber()) height = dict.GetKey("Height")->GetNumber(); + if (dict.HasKey("SMask") && dict.GetKey("SMask")->IsReference()) smask = dict.GetKey("SMask")->GetReference(); } Image(Image &&other) noexcept : - buf(std::move(other.buf)), width(other.width), height(other.height), ref(other.ref) { + buf(std::move(other.buf)), width(other.width), height(other.height), ref(other.ref), smask(other.smask) { other.buf = charbuff(); is_valid = other.is_valid; } Image& operator=(Image &&other) noexcept { buf = std::move(other.buf); other.buf = charbuff(); ref = other.ref; width = other.width; height = other.height; is_valid = other.is_valid; + smask = other.smask; return *this; } bool operator==(const Image &other) const noexcept { - return other.width == width && is_valid && other.is_valid && other.height == height && other.buf == buf; + return other.width == width && is_valid && other.is_valid && other.height == height && other.smask == smask && other.buf == buf; } std::size_t hash() const noexcept { return buf.size(); } const PdfReference& reference() const noexcept { return ref; }