Skip to content

Backfill compress existing 26 MB of images #35

Description

@jmxpearson

Summary

PR #32 added jpegoptim / oxipng / svgo pre-commit hooks (Phase 1) that compress images on commit. They only run on staged files, so the existing ~26 MB of legacy images in images/ stays untouched until each is modified.

A one-shot backfill would shrink the working tree by an estimated 30-60% (mostly from oversized JPGs like kevin.jpg at 3 MB and anne.jpg at 1.7 MB).

Approach

A maintainer runs pre-commit run --all-files (with the image hooks not skipped) and commits the result as a single dedicated PR. Note that .git history blob storage is not reduced — only the working tree and future clones benefit from the smaller files. Full .git reclaim would require git filter-repo and rewriting history, which we explicitly do not do here.

Acceptance

  • One-shot run of all image hooks across images/ and images/icons/
  • Verify visual quality of a representative sample (lab photos shouldn't look obviously degraded)
  • Commit as a single chore: backfill image compression PR
  • Drop du -sh images/ measurements before/after in the PR body

Notes

  • Phase 2's size cap will block any image still over 1 MB after compression. Some legacy photos may need editorial downscaling first (e.g., kevin.jpg at 3 MB → ~600 KB after jpegoptim --max=85 is still too big; needs to be downscaled to a sane web resolution like 800px wide).
  • .image-size-overrides is available for files that legitimately need to exceed 1 MB (high-res research figures).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions