mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-31 14:01:59 +00:00
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.
This commit is contained in:
parent
235c89e037
commit
4ff837f099
@ -2743,13 +2743,7 @@ QPDFJob::shouldRemoveUnreferencedResources(QPDF& pdf)
|
||||
for (auto const& k: xobject.getKeys())
|
||||
{
|
||||
QPDFObjectHandle xobj = xobject.getKey(k);
|
||||
if (xobj.isStream() &&
|
||||
xobj.getDict().getKey("/Type").isName() &&
|
||||
("/XObject" ==
|
||||
xobj.getDict().getKey("/Type").getName()) &&
|
||||
xobj.getDict().getKey("/Subtype").isName() &&
|
||||
("/Form" ==
|
||||
xobj.getDict().getKey("/Subtype").getName()))
|
||||
if (xobj.isFormXObject())
|
||||
{
|
||||
queue.push_back(xobj);
|
||||
}
|
||||
|
@ -3406,7 +3406,7 @@ QPDFObjectHandle::isPagesObject()
|
||||
bool
|
||||
QPDFObjectHandle::isFormXObject()
|
||||
{
|
||||
return isStreamOfType("/XObject", "/Form");
|
||||
return isStreamOfType("", "/Form");
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user