Backfill image cleanup: delete 2038 orphans, compress remaining 33 (closes #35) - #40
Merged
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 pastpeople.htmledits, 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 fromhead.html(apple-icon.png,apple-icon-precomposed.png, allms-icon-*, allandroid-icon-*other than the linked 192x192, andfavicon.ico— the last is auto-requested by browsers at/favicon.icobut 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, andsvgo --multipassacross the survivors. Biggest savings on icon PNGs (~50–70% each),plab_logotype.svg(43%),plab_hex_icon_gray.png(34%), andcaitlin.jpg(25%).Test plan
mouse_plot/1.jpgwhose name is a substring ofmutu1.jpgin a 2016 blog post)bundle exec jekyll buildproduces 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/MDlycheereports 0 errors / 84 OK / 426 excluded — no link rot introducedpre-commitandsite-healthpass on the PRSizes
Notes
.githistory is unchanged (filter-repo would have been the only way to reclaim those bytes, and we deliberately don't rewrite history)..gitwill 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