Commit 4ff837f099c4594fbb95463ebfd6199051d0fa30
Committed by
Jay Berkenbilt
1 parent
235c89e0
Fix tests for Form XObjects
Remove test for type == /XObject in QPDFObjectHandle::isFormXObject as type value is optional (as per spec 8.10.2). Replace code to test for /Form in QPDFJob::shouldRemoveUnreferencedResources with a call to isFormXObject.
Showing
2 changed files
with
2 additions
and
8 deletions
libqpdf/QPDFJob.cc
| ... | ... | @@ -2743,13 +2743,7 @@ QPDFJob::shouldRemoveUnreferencedResources(QPDF& pdf) |
| 2743 | 2743 | for (auto const& k: xobject.getKeys()) |
| 2744 | 2744 | { |
| 2745 | 2745 | QPDFObjectHandle xobj = xobject.getKey(k); |
| 2746 | - if (xobj.isStream() && | |
| 2747 | - xobj.getDict().getKey("/Type").isName() && | |
| 2748 | - ("/XObject" == | |
| 2749 | - xobj.getDict().getKey("/Type").getName()) && | |
| 2750 | - xobj.getDict().getKey("/Subtype").isName() && | |
| 2751 | - ("/Form" == | |
| 2752 | - xobj.getDict().getKey("/Subtype").getName())) | |
| 2746 | + if (xobj.isFormXObject()) | |
| 2753 | 2747 | { |
| 2754 | 2748 | queue.push_back(xobj); |
| 2755 | 2749 | } | ... | ... |
libqpdf/QPDFObjectHandle.cc