Validate C2PA credentials before attribution

This commit is contained in:
Victor Kuznetsov
2026-08-15 11:31:59 -07:00
parent 8201ada070
commit 2eab24a2e1
18 changed files with 826 additions and 47 deletions
+2 -1
View File
@@ -329,12 +329,13 @@ class _SourceEvidence:
if evidence is None:
return True
try:
from remove_ai_watermarks._internal.c2pa import c2pa_info_has_removal_hint
from remove_ai_watermarks.identify import identify_from_evidence
report = identify_from_evidence(evidence, image_path=self._path, check_invisible=True)
except Exception:
return True
return bool(report.ai_from_metadata)
return report.ai_from_metadata or c2pa_info_has_removal_hint(evidence.c2pa_info)
def _provenance_from_report(report: Any, path: Path) -> frozenset[str]: