Skip to content

feat(verify): Wikipedia Commons smartphone image backfill - #85

Merged
Seungpyo1007 merged 2 commits into
mainfrom
feat/wikipedia-image-backfill
Sep 24, 2026
Merged

Seungpyo1007 merged 2 commits into
mainfrom
feat/wikipedia-image-backfill

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

Summary

New tool app/verify/wikipedia_image_backfill.py: for smartphone records with an explicit image_url: null and an already-cited Wikipedia source_url, fetch the article's lead image via the Wikipedia API, resolve it on Commons, and only accept it if (a) the license is a permissive/free one (CC0/CC-BY/CC-BY-SA — non-free/fair-use rejected), (b) the file is JPEG/WebP (PNG/SVG rejected as logo/diagram-shaped), and (c) the filename/description carries the exact model identity (reuses variant_conflict from wikipedia_smartphone_backfill.py to reject Pro/Plus/etc mismatches, rejects brand-only or "series" group-photo matches).

Iterated through several dry-run rounds against real failure modes before running for real: generic renders (iPod touch PNG), unrelated photos (a damaged battery, a company HQ building), and identity mismatches (P40 photo used for P40 Pro, OnePlus Ace 3 used for OnePlus 12R) were all caught and gated out before any data was written.

Applied to TechAPI: 47/354 eligible records got a real, licensed image (CC-BY-SA-4.0 ×29, CC-BY-2.0 ×6, CC-BY-4.0 ×5, CC0-1.0 ×4, CC-BY-SA-2.0/3.0 ×2). 113 had no usable Wikipedia image, 1 was non-free-licensed, 193 were rejected as logo-like or identity mismatches — left null rather than guessed.

Test plan

  • pytest tests/verify/test_wikipedia_image_backfill.py — passed
  • ruff — passed

@Seungpyo1007 Seungpyo1007 self-assigned this Sep 24, 2026
@Seungpyo1007
Seungpyo1007 merged commit 3e1a6b1 into main Sep 24, 2026
1 check passed
@Seungpyo1007
Seungpyo1007 deleted the feat/wikipedia-image-backfill branch September 24, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant