1
0
mirror of https://github.com/kanzure/pdfparanoia.git synced 2024-12-04 23:15:52 +01:00

AIP: better false-positives check

This commit is contained in:
Bryan Bishop 2013-02-05 17:20:11 -06:00
parent d276954bfa
commit f78aad78ef

View File

@ -35,12 +35,15 @@ class AmericanInstituteOfPhysics(Plugin):
if hasattr(obj, "attrs"):
# watermarks tend to be in FlateDecode elements
if obj.attrs.has_key("Filter") and str(obj.attrs["Filter"]) == "/FlateDecode":
#length = obj.attrs["Length"]
#rawdata = copy(obj.rawdata)
data = copy(obj.get_data())
length = obj.attrs["Length"]
if "Redistribution subject to AIP license or copyright" in data:
evil_ids.append(objid)
# the watermark is never very long
if length < 1000:
#rawdata = copy(obj.rawdata)
data = copy(obj.get_data())
if "Redistribution subject to AIP license or copyright" in data:
evil_ids.append(objid)
for objid in evil_ids:
content = remove_object_by_id(content, objid)