Skip to content

Backfill image cleanup: delete 2038 orphans, compress remaining 33 (closes #35) - #40

Merged
jmxpearson merged 3 commits into
masterfrom
claude/issue-35-image-backfill
May 12, 2026
Merged

Backfill image cleanup: delete 2038 orphans, compress remaining 33 (closes #35)#40
jmxpearson merged 3 commits into
masterfrom
claude/issue-35-image-backfill

Conversation

@jmxpearson

Copy link
Copy Markdown
Member

Closes #35.

Summary

Cleaned images/ from 33 MB to 7.8 MB (76% reduction) by deleting 2038 orphan files and compressing the 33 that survive.

What was deleted (2038 files, ~25 MB)

  • images/mouse_plot/ (2000 tiny JPGs, ~10 MB): data for an interactive viz paired with a 2016 blog post that either never shipped or was rolled back. No source file referenced these.
  • images/ top-level (26 files, ~10 MB): former lab member photos (anne, jack, kevin, raphael, etc.) left over from past people.html edits, plus a handful of unused logo/background variants (plab_logo_light.svg, plab_logotype_white.svg, chapel_noir.jpg, chapel_org.jpg, thumbnail.png, github_logo.png, dibs_logo.jpg).
  • images/icons/ (12 files, ~0.2 MB): extra icon sizes from a PWA-style generator that aren't linked from head.html (apple-icon.png, apple-icon-precomposed.png, all ms-icon-*, all android-icon-* other than the linked 192x192, and favicon.ico — the last is auto-requested by browsers at /favicon.ico but currently lives at /images/icons/ so was already not being auto-found).

All files remain in git history if anything needs recovery.

What was compressed (33 files)

Ran jpegoptim --max=85, oxipng -o 4, and svgo --multipass across the survivors. Biggest savings on icon PNGs (~50–70% each), plab_logotype.svg (43%), plab_hex_icon_gray.png (34%), and caitlin.jpg (25%).

Test plan

  • Two-pass orphan scan: substring-matching first pass (caught most), word-boundary-matching second pass caught one straggler (mouse_plot/1.jpg whose name is a substring of mutu1.jpg in a 2016 blog post)
  • bundle exec jekyll build produces a clean _site/
  • python3 scripts/check_image_refs.py (the new hook from Add broken-image pre-commit hook + CI check #34) is happy across all HTML/MD
  • lychee reports 0 errors / 84 OK / 426 excluded — no link rot introduced
  • CI pre-commit and site-health pass on the PR
  • Visual spot-check post-merge: home, people, research, location

Sizes

Files Size
Before 2071 33 MB
After orphan delete 33 8.7 MB
After compression 33 7.8 MB

Notes

  • .git history is unchanged (filter-repo would have been the only way to reclaim those bytes, and we deliberately don't rewrite history).
  • The legacy ~26 MB in .git will gradually amortize as GitHub does periodic repacks, and new clones already benefit from the smaller working tree.

https://claude.ai/code/session_01S5QXfkxZBNSAf2Y1XAD8H7


Generated by Claude Code

claude added 3 commits May 12, 2026 01:56
Audited every file in images/ against all source files (HTML, MD,
includes, layouts, posts, data, css, js, scripts). 2037 of 2071
images had no reference anywhere in the source.

Categories removed:
- images/mouse_plot/ (1999 tiny JPGs, ~10 MB): looks like data for an
  interactive viz paired with a 2016 blog post that either never
  shipped or got rolled back. Nothing referenced these files.
- images/ top-level (26 files, ~10 MB): former lab member photos
  (anne, jack, kevin, raphael, etc.) left over from past people.html
  edits, plus a handful of unused logo/background variants
  (plab_logo_light/_logotype_white.svg, chapel_noir/_org.jpg,
  thumbnail.png, github_logo.png, dibs_logo.jpg).
- images/icons/ (12 files, ~0.2 MB): extra icon sizes from a
  PWA-style generator that aren't linked from head.html
  (apple-icon-precomposed.png, apple-icon.png, ms-icon-*,
  android-icon-* except the linked 192x192, favicon.ico — the last
  is auto-requested by browsers at /favicon.ico but currently lives
  at /images/icons/ so was already not being auto-found).

All files remain in git history if anything needs to be recovered.

images/ before: 33M
images/ after:   8.8M
mouse_plot/1.jpg wasn't flagged by the first scan because its name
(1.jpg) appears as a substring of mutu1.jpg in a 2016 blog post.
Re-ran with word-boundary matching to catch it.
Ran jpegoptim --max=85, oxipng -o 4, and svgo --multipass across
images/, images/icons/, and images/location/. Savings:
- icons (apple/android/favicon PNGs): ~50-70% each
- plab_logotype.svg: 43% (now 18.5 KB)
- plab_logo_dark.svg: 18% (now 35.7 KB)
- plab_hex_icon_gray.png: 34%
- caitlin.jpg: 25%
- miles.jpg, gong.png, chapel_gradient.jpg: smaller gains

images/ before this commit: 8.7 MB
images/ after:               7.8 MB
images/ vs. pre-cleanup:     33 MB -> 7.8 MB (76% reduction)
@jmxpearson
jmxpearson merged commit 151b26d into master May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backfill compress existing 26 MB of images

2 participants