aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index a0d45c86..b802a55c 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -18,6 +18,7 @@
#include <qpdf/Pl_QPDFTokenizer.hh>
#include <qpdf/BufferInputSource.hh>
#include <qpdf/QPDFExc.hh>
+#include <qpdf/QPDFPageObjectHelper.hh>
#include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh>
@@ -1109,24 +1110,11 @@ QPDFObjectHandle::getGeneration() const
std::map<std::string, QPDFObjectHandle>
QPDFObjectHandle::getPageImages()
{
- // Note: this code doesn't handle inherited resources. If this
- // page dictionary doesn't have a /Resources key or has one whose
- // value is null or an empty dictionary, you are supposed to walk
- // up the page tree until you find a /Resources dictionary. As of
- // this writing, I don't have any test files that use inherited
- // resources, and hand-generating one won't be a good test because
- // any mistakes in my understanding would be present in both the
- // code and the test file.
-
- // NOTE: If support of inherited resources (see above comment) is
- // implemented, edit comment in QPDFObjectHandle.hh for this
- // function. Also remove call to pushInheritedAttributesToPage
- // from qpdf.cc when show_page_images is true.
-
std::map<std::string, QPDFObjectHandle> result;
- if (this->hasKey("/Resources"))
+ QPDFObjectHandle resources =
+ QPDFPageObjectHelper(*this).getAttribute("/Resources", false);
+ if (resources.isDictionary())
{
- QPDFObjectHandle resources = this->getKey("/Resources");
if (resources.hasKey("/XObject"))
{
QPDFObjectHandle xobject = resources.getKey("/XObject");