mirror of
https://github.com/kanzure/pdfparanoia.git
synced 2025-05-25 09:04:23 +02:00
AIP: better false-positives check
This commit is contained in:
parent
d276954bfa
commit
f78aad78ef
@ -35,12 +35,15 @@ class AmericanInstituteOfPhysics(Plugin):
|
|||||||
if hasattr(obj, "attrs"):
|
if hasattr(obj, "attrs"):
|
||||||
# watermarks tend to be in FlateDecode elements
|
# watermarks tend to be in FlateDecode elements
|
||||||
if obj.attrs.has_key("Filter") and str(obj.attrs["Filter"]) == "/FlateDecode":
|
if obj.attrs.has_key("Filter") and str(obj.attrs["Filter"]) == "/FlateDecode":
|
||||||
#length = obj.attrs["Length"]
|
length = obj.attrs["Length"]
|
||||||
#rawdata = copy(obj.rawdata)
|
|
||||||
data = copy(obj.get_data())
|
|
||||||
|
|
||||||
if "Redistribution subject to AIP license or copyright" in data:
|
# the watermark is never very long
|
||||||
evil_ids.append(objid)
|
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:
|
for objid in evil_ids:
|
||||||
content = remove_object_by_id(content, objid)
|
content = remove_object_by_id(content, objid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user