c2pa-scanner 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. c2pa_scanner-0.7.1/LICENSE +201 -0
  2. c2pa_scanner-0.7.1/PKG-INFO +283 -0
  3. c2pa_scanner-0.7.1/README.md +244 -0
  4. c2pa_scanner-0.7.1/pyproject.toml +87 -0
  5. c2pa_scanner-0.7.1/setup.cfg +4 -0
  6. c2pa_scanner-0.7.1/src/c2pa_scanner/__init__.py +5 -0
  7. c2pa_scanner-0.7.1/src/c2pa_scanner/__main__.py +393 -0
  8. c2pa_scanner-0.7.1/src/c2pa_scanner/app.py +944 -0
  9. c2pa_scanner-0.7.1/src/c2pa_scanner/app.tcss +89 -0
  10. c2pa_scanner-0.7.1/src/c2pa_scanner/domain/__init__.py +1 -0
  11. c2pa_scanner-0.7.1/src/c2pa_scanner/domain/models.py +36 -0
  12. c2pa_scanner-0.7.1/src/c2pa_scanner/i18n.py +119 -0
  13. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/__init__.py +1 -0
  14. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/asyncio_guard.py +43 -0
  15. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/browser.py +120 -0
  16. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/c2pa_reader.py +239 -0
  17. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/c2pa_signer.py +154 -0
  18. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/consent.py +144 -0
  19. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/history.py +62 -0
  20. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/proxy_detect.py +60 -0
  21. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/rate_limit.py +54 -0
  22. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/robots.py +127 -0
  23. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/settings.py +35 -0
  24. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/sitemap.py +190 -0
  25. c2pa_scanner-0.7.1/src/c2pa_scanner/infrastructure/web.py +145 -0
  26. c2pa_scanner-0.7.1/src/c2pa_scanner/locale/de.json +180 -0
  27. c2pa_scanner-0.7.1/src/c2pa_scanner/locale/en.json +180 -0
  28. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/__init__.py +1 -0
  29. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/c2pa_details.py +61 -0
  30. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/history_screen.py +97 -0
  31. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/proxy_warning.py +50 -0
  32. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/scan_summary.py +97 -0
  33. c2pa_scanner-0.7.1/src/c2pa_scanner/screens/settings_screen.py +226 -0
  34. c2pa_scanner-0.7.1/src/c2pa_scanner/services/__init__.py +1 -0
  35. c2pa_scanner-0.7.1/src/c2pa_scanner/services/classify.py +69 -0
  36. c2pa_scanner-0.7.1/src/c2pa_scanner/services/export.py +106 -0
  37. c2pa_scanner-0.7.1/src/c2pa_scanner/services/preview_service.py +252 -0
  38. c2pa_scanner-0.7.1/src/c2pa_scanner/services/sitemap_scan.py +263 -0
  39. c2pa_scanner-0.7.1/src/c2pa_scanner/widgets/__init__.py +1 -0
  40. c2pa_scanner-0.7.1/src/c2pa_scanner/widgets/findings_table.py +267 -0
  41. c2pa_scanner-0.7.1/src/c2pa_scanner/widgets/preview_panel.py +139 -0
  42. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/PKG-INFO +283 -0
  43. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/SOURCES.txt +63 -0
  44. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/dependency_links.txt +1 -0
  45. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/entry_points.txt +2 -0
  46. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/requires.txt +18 -0
  47. c2pa_scanner-0.7.1/src/c2pa_scanner.egg-info/top_level.txt +1 -0
  48. c2pa_scanner-0.7.1/tests/test_app_bindings.py +88 -0
  49. c2pa_scanner-0.7.1/tests/test_asyncio_guard.py +62 -0
  50. c2pa_scanner-0.7.1/tests/test_c2pa_availability.py +40 -0
  51. c2pa_scanner-0.7.1/tests/test_classify.py +55 -0
  52. c2pa_scanner-0.7.1/tests/test_consent.py +119 -0
  53. c2pa_scanner-0.7.1/tests/test_crash_log.py +98 -0
  54. c2pa_scanner-0.7.1/tests/test_export.py +51 -0
  55. c2pa_scanner-0.7.1/tests/test_i18n.py +118 -0
  56. c2pa_scanner-0.7.1/tests/test_preview_service.py +32 -0
  57. c2pa_scanner-0.7.1/tests/test_programmstart.py +77 -0
  58. c2pa_scanner-0.7.1/tests/test_rate_limit.py +80 -0
  59. c2pa_scanner-0.7.1/tests/test_robots.py +94 -0
  60. c2pa_scanner-0.7.1/tests/test_roundtrip.py +52 -0
  61. c2pa_scanner-0.7.1/tests/test_safe_defaults.py +39 -0
  62. c2pa_scanner-0.7.1/tests/test_scan_cancel.py +130 -0
  63. c2pa_scanner-0.7.1/tests/test_scan_rate_limit.py +91 -0
  64. c2pa_scanner-0.7.1/tests/test_sitemap_discovery.py +54 -0
  65. c2pa_scanner-0.7.1/tests/test_web.py +126 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and do
117
+ not modify the License. You may add Your own attribution notices
118
+ within Derivative Works that You distribute, alongside or as an
119
+ addendum to the NOTICE text from the Work, provided that such
120
+ additional attribution notices cannot be construed as modifying
121
+ the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Michael Blaess
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,283 @@
1
+ Metadata-Version: 2.4
2
+ Name: c2pa-scanner
3
+ Version: 0.7.1
4
+ Summary: Detect C2PA provenance / AI-generated images in website sitemaps (EU AI Act Art. 50)
5
+ Author: Michael Blaess
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/michaelblaess/c2pa-scanner
8
+ Project-URL: Repository, https://github.com/michaelblaess/c2pa-scanner
9
+ Project-URL: Issues, https://github.com/michaelblaess/c2pa-scanner/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
17
+ Classifier: Topic :: Multimedia :: Graphics
18
+ Requires-Python: >=3.12
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: c2pa-python>=0.36
22
+ Requires-Dist: Pillow>=10.0
23
+ Requires-Dist: cryptography>=42.0
24
+ Requires-Dist: httpx>=0.25
25
+ Requires-Dist: playwright>=1.40
26
+ Requires-Dist: textual>=0.80
27
+ Requires-Dist: rich>=13.0
28
+ Requires-Dist: textual-image[textual]>=0.12.0
29
+ Requires-Dist: textual-fspicker>=1.0
30
+ Requires-Dist: textual-themes[textual]>=0.15.1
31
+ Requires-Dist: textual-widgets>=0.32.1
32
+ Requires-Dist: textual-slider>=0.2.0
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=8.0; extra == "dev"
35
+ Requires-Dist: mypy>=1.8; extra == "dev"
36
+ Requires-Dist: ruff>=0.6; extra == "dev"
37
+ Requires-Dist: poethepoet>=0.27; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # c2pa-scanner
41
+
42
+ <p align="center">
43
+ <img src="https://raw.githubusercontent.com/michaelblaess/c2pa-scanner/0f5bc531cf45dc972c60fc1313adf01a209f72a8/docs/flags/gb.svg" height="13" alt=""> <b>English</b> &middot;
44
+ <img src="https://raw.githubusercontent.com/michaelblaess/c2pa-scanner/0f5bc531cf45dc972c60fc1313adf01a209f72a8/docs/flags/de.svg" height="13" alt=""> <a href="https://github.com/michaelblaess/c2pa-scanner/blob/0f5bc531cf45dc972c60fc1313adf01a209f72a8/README.de.md">Deutsch</a>
45
+ </p>
46
+
47
+ ---
48
+
49
+ <p align="center">
50
+ <img src="https://raw.githubusercontent.com/michaelblaess/c2pa-scanner/0f5bc531cf45dc972c60fc1313adf01a209f72a8/docs/banner.jpg" alt="c2pa-scanner - images labeled as AI-generated, AI-edited or verified origin" width="100%">
51
+ <br>
52
+ <sub>This banner is AI-generated (Google Gemini) and carries its signed C2PA manifest -
53
+ c2pa-scanner classifies it as <b>AI-generated</b> (<code>trainedAlgorithmicMedia</code>).</sub>
54
+ </p>
55
+
56
+ Detects the **C2PA provenance manifest** in images and flags the ones that are
57
+ **AI-generated** - so you can label them as required by the EU AI Act (Art. 50).
58
+
59
+ It reads the `digitalSourceType` from a C2PA manifest (e.g. embedded automatically by Adobe /
60
+ Firefly) and classifies each image: AI-generated, AI-edited, other provenance, or none.
61
+
62
+ ## What this tool is for - and what it is not
63
+
64
+ > **This tool checks your own images and pages** for AI labeling under the EU AI Act and
65
+ > makes them compliant - nothing more.
66
+ >
67
+ > It is **explicitly NOT** meant to scan third-party websites, collect violations and turn them
68
+ > into cease-and-desist letters. If that is your plan, you are in the wrong place.
69
+ >
70
+ > For context: the C2PA scan is only an **indicator** - it only finds images that carry a
71
+ > provenance manifest (e.g. Adobe / Firefly), never all AI images. It is not legal advice and not
72
+ > proof of a violation. Use it fairly.
73
+ >
74
+ > **Legal basis:** EU AI Act (Regulation (EU) 2024/1689), in particular Article 50 (transparency
75
+ > obligations), applicable from 2 August 2026.
76
+ > Legal text (EUR-Lex): https://eur-lex.europa.eu/eli/reg/2024/1689/oj
77
+ > Article 50 (readable): https://artificialintelligenceact.eu/article/50/
78
+
79
+ ## Load on the target system - please read this
80
+
81
+ Crawling a sitemap means fetching **every page and every image** it lists. With browser
82
+ rendering enabled, each page additionally goes through a real Chromium, which bypasses the
83
+ server's caches. On a large site this quickly adds up to several hundred requests per minute and
84
+ can noticeably degrade a production system - slower responses, in the worst case a server pushed
85
+ to its memory limit.
86
+
87
+ The scanner is therefore **rate-limited out of the box**: 60 requests per minute, counting
88
+ pages, renderings and images together. Change it under *Settings -> Scan*, or on the command
89
+ line:
90
+
91
+ ```bash
92
+ c2pa-scanner scan https://www.example.com/sitemap.xml --rate-limit 20 # gentler
93
+ c2pa-scanner scan https://www.example.com/sitemap.xml --rate-limit 0 # no limit - be careful
94
+ ```
95
+
96
+ Two things worth knowing:
97
+
98
+ - **"Parallel requests" is not a rate limit.** It caps how many requests run at the same time,
99
+ not how many go out per minute. Only the rate limit does that.
100
+ - **With rendering, the limit throttles page requests only.** Whatever the browser pulls in
101
+ afterwards - scripts, fonts, images - is not counted, so the real load is higher than the
102
+ configured number.
103
+
104
+ `robots.txt` is honoured by default for the pages listed in the sitemap; blocked pages are
105
+ skipped and reported in the log. Images are not checked against it, because they often live on a
106
+ separate CDN domain with its own rules. You can turn this off in the settings for systems of
107
+ your own - for instance a staging site that blocks everything by default.
108
+
109
+ ## Use at your own risk
110
+
111
+ This program retrieves web pages automatically and thereby places load on the target systems.
112
+ Depending on its settings, that load can exceed the load of an ordinary visitor many times over
113
+ and can impair the availability of the target system.
114
+
115
+ By using it, you declare that:
116
+
117
+ 1. You will use this program only against systems for which you hold explicit authorisation from
118
+ their operator.
119
+ 2. You bear sole responsibility for its use, for the settings you choose and for all
120
+ consequences arising from them.
121
+ 3. Before running it against a production system, you will verify that the configured limits are
122
+ appropriate for that system.
123
+
124
+ The software is provided free of charge and without warranty of any kind ("as is"), as set out in
125
+ section 7 of the Apache License 2.0. The liability of the author (Michael Blaess) for damages
126
+ arising from its use is excluded to the extent permitted by applicable law. Liability for intent
127
+ and gross negligence, for injury to life, body or health, and under mandatory product liability
128
+ law remains unaffected.
129
+
130
+ On first start the program asks you to confirm this notice. On the command line, confirm it once
131
+ with `--accept-disclaimer`.
132
+
133
+ ## Usage
134
+
135
+ ```bash
136
+ # Launch the graphical TUI (default when no command is given)
137
+ c2pa-scanner
138
+ c2pa-scanner tui https://www.example.com/sitemap.xml
139
+
140
+ # Crawl a sitemap and check every image for C2PA / AI provenance (a bare domain
141
+ # works too - the sitemap is then discovered automatically). The first run needs
142
+ # --accept-disclaimer once; the rate limit defaults to 60 requests per minute.
143
+ c2pa-scanner scan https://www.example.com/sitemap.xml --accept-disclaimer
144
+ c2pa-scanner scan ./sitemap.xml
145
+
146
+ # Render each page in Chromium as well (finds JS / shadow-DOM images, much heavier)
147
+ c2pa-scanner scan https://www.example.com/sitemap.xml --render --rate-limit 20
148
+
149
+ # Leave cookie banners in place instead of accepting them (only affects --render)
150
+ c2pa-scanner scan https://www.example.com/sitemap.xml --render --no-consent
151
+
152
+ # Create a signed C2PA test image (positive test fixture)
153
+ c2pa-scanner make-testimage ./test-ai.jpg
154
+ c2pa-scanner make-testimage ./test-edited.jpg --edited
155
+ ```
156
+
157
+ ## How it works
158
+
159
+ Detection is layered and deliberately tuned for few false positives:
160
+
161
+ - **C2PA manifest** (primary signal): the official `c2pa` library reads the signed manifest; the
162
+ `digitalSourceType` assertion decides the verdict (`trainedAlgorithmicMedia` = AI-generated,
163
+ `compositeWithTrainedAlgorithmicMedia` = AI-edited).
164
+ - **XMP/EXIF `digitalSourceType`** (secondary signal): the same IPTC marker is also read from XMP when
165
+ there is no valid C2PA - this catches images that lost their signature on resize but kept the XMP.
166
+ - **Generating tool** (fallback): if there is no `digitalSourceType` at all, the `Software` /
167
+ `CreatorTool` tag is matched against a curated list of unambiguous generative-AI tools (Midjourney,
168
+ DALL-E, Stable Diffusion, Adobe Firefly, ...). Ambiguous editors like Photoshop or GIMP are
169
+ deliberately NOT on the list, to avoid false positives.
170
+ - **Page crawl:** all pages from a sitemap are fetched and image URLs are extracted via regex over the
171
+ raw HTML - this also finds images in web-component attributes / shadow DOM, not just classic
172
+ `<img src>`. If no direct sitemap URL is given, it is discovered automatically (robots.txt, then
173
+ common paths). For a more complete sitemap than the official one, use the companion tool
174
+ [Sitemap-Tracker](https://github.com/michaelblaess/sitemap-tracker) and load its XML output as a
175
+ local file.
176
+ - **Browser rendering** (optional, off by default): when enabled, each page is additionally rendered in
177
+ a headless Chromium (Playwright), adding images that only appear in the (shadow) DOM after JavaScript
178
+ runs - as a union with the regex extraction.
179
+ - **Cookie consent** (on by default): a banner is confirmed automatically once it has loaded
180
+ (Usercentrics, OneTrust, Cookiebot; otherwise by clicking the accept button inside the banner). This
181
+ matters because many sites only release their images after consent - and because the banner otherwise
182
+ covers the page preview. The consent manager is loaded by a script and is not there yet when the page
183
+ fires its load event, so the tool waits for it instead of guessing once. Switch it off under
184
+ *Settings -> Scan*, or on the command line with `--no-consent`.
185
+
186
+ **Limits:** images with no provenance signal at all (no C2PA, no XMP/EXIF) cannot be flagged as AI.
187
+ Metadata can be stripped - screenshots, re-saving, and many platforms remove it on upload. A hit is a
188
+ solid indication **for** AI; its absence is **not** proof against it. Any resize/crop breaks the C2PA
189
+ signature, so scan the original master where possible.
190
+
191
+ ### In the TUI
192
+
193
+ - **Live image preview** next to the result list, with a clickable link to the source page and a dialog
194
+ for the raw C2PA manifest.
195
+ - **Page preview** (optional): below the image, a screenshot of the rendered source page scrolled to the
196
+ image - so you can check without leaving the tool whether an AI label is shown on/near the image. A
197
+ cookie banner is dismissed beforehand (see above).
198
+ - **Cancel a scan** with `x`: the key only appears in the footer while a run is in progress. The
199
+ cancellation is cooperative - requests already under way finish, no new ones start, and the images
200
+ found so far stay in the table. Before, only `q` was left, and that discarded the partial result.
201
+ - **Filter & sorting**, an "AI images only" toggle, **export** via right-click (JSON, JIRA table, plain
202
+ text) and **test-image signing** as a positive fixture. The JIRA table comes in two formats
203
+ (Settings -> Export): **Markdown** for Jira Cloud (converts to a real table when pasted into a
204
+ comment) and **Wiki Markup** for older Jira Server/Data Center instances.
205
+
206
+ - **Two languages**: the interface is available in English and German. On first start the language
207
+ follows your system environment - German only for a demonstrably German-speaking environment,
208
+ everything else (including any error while reading it) falls back to English. You can switch at
209
+ any time under *Settings -> Language*; the setting takes effect after a restart.
210
+
211
+ ### Other detection methods - and why they are (not yet) implemented
212
+
213
+ For completeness, the alternatives that exist but are deliberately NOT built in:
214
+
215
+ - **Invisible watermarks** (Google SynthID, Meta, Amazon Titan): robust against edits, but each scheme
216
+ needs its vendor's own detector - there is no open, universal reader. SynthID can only be checked via
217
+ Google's own portal, not as a library. **Reason: not integrable.**
218
+ - **ML classifiers** ("is this AI?", e.g. Hive, Sensity, Illuminarty): unreliable across generators and
219
+ after compression/resize (high false-positive AND false-negative rates), age quickly, adversarially
220
+ fragile. **Reason: not defensible for a labeling decision** - it would undermine the solid verdict; at
221
+ most conceivable as a separately flagged "uncertain hint" that does not drive the result.
222
+ - **Forensics/statistics** (frequency spectrum, noise residuals, diffusion fingerprints): research-grade,
223
+ no turnkey tool, same reliability caveats as ML classifiers. **Reason: effort vs. value does not add
224
+ up.**
225
+ - **Fingerprint/hash matching** against a registry of known AI images: only works if the image is
226
+ registered there - not a general solution. **Reason: coverage too low.**
227
+
228
+ The guiding principle: prefer a few solid signals (provenance) over many uncertain ones - fitting the
229
+ purpose of supporting compliant AI labeling under EU AI Act Art. 50.
230
+
231
+ ## When something goes wrong
232
+
233
+ ### It will not start on an Intel Mac
234
+
235
+ `zsh: bad CPU type in executable` means the architecture does not match: the
236
+ release binaries are built for Apple Silicon (arm64) only. Rosetta cannot fix
237
+ this - it translates x86 to arm, not the other way round, and a software update
238
+ does not help either.
239
+
240
+ Run it from source instead - that route works on both architectures, because
241
+ [uv](https://docs.astral.sh/uv/) fetches the Python matching your processor:
242
+
243
+ ```bash
244
+ git clone https://github.com/michaelblaess/c2pa-scanner.git
245
+ cd c2pa-scanner
246
+ ./bootstrap.sh # once
247
+ ./run.sh # every time
248
+ ```
249
+
250
+ ### Crash reports
251
+
252
+ If the program crashes, the report is written to disk instead of only to the
253
+ terminal - two files next to the settings, both linked from the storage tab in
254
+ the settings once they exist:
255
+
256
+ | File | What for |
257
+ | --- | --- |
258
+ | `last-crash.txt` | Python errors including the traceback. Written **before** the error dialog runs - if that dialog dies during its own re-layout, the report would otherwise be lost. |
259
+ | `fault.log` | Everything below that: native access violations, stack overflow, fatal interpreter errors. Such crashes bypass Python's error handling entirely. |
260
+
261
+ Both files are **appended to**, not replaced - a second crash does not hide the
262
+ first one.
263
+
264
+ `fault.log` also gets a start and an end line per run, which makes the file
265
+ readable at a glance:
266
+
267
+ | What the file contains | What it means |
268
+ | --- | --- |
269
+ | start, traceback, end | Python error, the program saw it |
270
+ | start, end | exited cleanly |
271
+ | start, then nothing | process was killed - **not** a Python error |
272
+
273
+ A killed process and a crash look identical in the terminal. Only the missing
274
+ end line tells them apart.
275
+
276
+ On Windows, prefer starting the program via `run.ps1`: the script restores the
277
+ terminal even when the program crashes hard and can no longer do so itself.
278
+ Otherwise mouse tracking stays on and every mouse move spills control
279
+ characters into your prompt.
280
+
281
+ ## License
282
+
283
+ Apache-2.0.