Verification
Verify images against trust profiles to determine if they meet your provenance requirements. The verifier extracts metadata, evaluates each check expression, and produces a trust report with a score.
How verification works
Verification loads the image metadata (the "indicator") and the trust profile YAML. The profile's first document is merged into the evaluation context. Then each check expression is evaluated against the combined data. The final score is the ratio of passed checks to total checks.
Pass ≥ 0.95
Warning ≥ 0.70
Fail < 0.70
Workflow
Verification workflow
Input image + trust profile
↓
verify_image()
↓
Extract metadata from image
↓
Parse profile YAML documents
↓
Evaluate each check expression
↓
Compute score (passed / total)
↓
Detect markers
↓
Output: VerificationReport
Python API
High-level: file paths
from jpegtrust import verify_image report = verify_image("signed.jpg", "profile.yml") print(f"Status: {report.status}") # "pass" | "warning" | "fail" print(f"Score: {report.score}") # 0.0 - 1.0 print(f"Verdict: {report.verdict}") # "trusted" | "mostly_trusted" | "profile_mismatch" print(f"Passed: {report.passed}") # ["signature_chain", "pixel_hash", ...] print(f"Failed: {report.failed}") # ["gps_location", ...]
Low-level: indicator dict
from jpegtrust import verify, extract_from_file, load_profile # Extract indicator from image indicator = extract_from_file("signed.jpg") # Load profile YAML profile_yaml = load_profile("profile.yml") # Verify report = verify(indicator, profile_yaml) # Convert to dict for JSON serialization result = report.to_dict()
CLI
# Human-readable output jpegtrust verify signed.jpg profile.yml # JSON output for pipelines jpegtrust verify signed.jpg profile.yml --format json # Batch verify a directory jpegtrust batch verify ./signed profile.yml jpegtrust batch verify ./signed profile.yml --format json
Verification report
The VerificationReport object contains the full results of verification:
Field Type Description
status "pass" | "warning" | "fail" Overall trust status
score float (0-1) Ratio of passed to total checks
verdict str "trusted", "mostly_trusted", or "profile_mismatch"
profile str Profile name from metadata
passed list[str] IDs of passed checks
failed list[str] IDs of failed checks
total_checks int Number of expression checks
sections list Detailed per-section results
c2pa C2PAInfo C2PA detection and validation
Example results
Pass (all checks met)
{
"status": "pass",
"score": 1.0,
"verdict": "trusted",
"passed_checks": 9,
"total_checks": 9,
"failed": []
}Warning (some checks missing)
{
"status": "warning",
"score": 0.7778,
"verdict": "mostly_trusted",
"passed_checks": 7,
"total_checks": 9,
"failed": ["gps_location", "data_mining"]
}Fail (below threshold)
{
"status": "fail",
"score": 0.3333,
"verdict": "profile_mismatch",
"passed_checks": 3,
"total_checks": 9,
"failed": ["capture_timestamp", "author_identity", ...]
}