Skip to content

fix: remove JPG fallback generation from image optimizer script#389

Merged
AdamJ merged 1 commit intomainfrom
claude/cleanup-images-webp-KCDjp
Mar 25, 2026
Merged

fix: remove JPG fallback generation from image optimizer script#389
AdamJ merged 1 commit intomainfrom
claude/cleanup-images-webp-KCDjp

Conversation

@AdamJ
Copy link
Owner

@AdamJ AdamJ commented Mar 24, 2026

Summary

Removed the JPG fallback image generation logic from the image optimization build script and deleted all pre-generated JPG fallback files from the repository.

Changes Made

  • scripts/image-optimizer.js: Removed the code that generated JPG fallback versions of images (both full-size at 1200px and thumbnail versions at 300px with varying quality settings)
  • src/assets/img/: Deleted all pre-generated JPG files (~400+ files), keeping only WebP versions as the primary format
  • src/404.html & src/_includes/base.njk: Updated meta tags to reference WebP images instead of JPG fallbacks

Details

The image optimizer was previously generating both WebP and JPG versions of all images for browser compatibility. This change simplifies the build process and repository by:

  • Removing redundant JPG generation (14 lines of code)
  • Eliminating storage overhead from duplicate image files
  • Relying on WebP as the primary format with modern browser support

This assumes WebP support is sufficient for the target audience or that a runtime fallback mechanism is in place.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 24, 2026

Deploying adamj-github-io with  Cloudflare Pages  Cloudflare Pages

Latest commit: 872c967
Status: ✅  Deploy successful!
Preview URL: https://e7bb53c9.adamj-github-io.pages.dev
Branch Preview URL: https://claude-cleanup-images-webp-k.adamj-github-io.pages.dev

View logs

@github-actions github-actions bot added the minor Minor release tag label Mar 24, 2026
@AdamJ AdamJ force-pushed the claude/cleanup-images-webp-KCDjp branch from 539d00b to b2dcb69 Compare March 25, 2026 00:02
@AdamJ AdamJ self-assigned this Mar 25, 2026
@AdamJ AdamJ changed the title Remove JPG fallback generation from image optimizer script fix: remove JPG fallback generation from image optimizer script Mar 25, 2026
- Delete all 292 .jpg fallback files from src/assets/img/ (never referenced in HTML)
- Delete 195 unused .webp files from src/assets/img/ (not referenced in any page or template)
- src/assets/img/ reduced from 584 files to 97 WebP-only files
- Update scripts/image-optimizer.js to only output WebP (remove JPEG generation)
- Fix OG image meta tag in base.njk and 404.html: social_template.jpg → .webp
- Fix headshot reference in town-selectman.md: broken ../../img/headshot.jpg → /assets/img/headshot.webp
- Fix 4 ChatGPT image refs in year-in-review/2025.md: broken relative .jpeg paths → absolute .webp paths
- Fix 2 image refs in reference.md: broken ../../../src/img/*.png → /assets/img/*.webp

https://claude.ai/code/session_01UvvGnVmNqiTBZPiDuSvyPK
@AdamJ AdamJ force-pushed the claude/cleanup-images-webp-KCDjp branch from b2dcb69 to 872c967 Compare March 25, 2026 00:05
@AdamJ AdamJ merged commit 6ee3b0e into main Mar 25, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from Ideas to Done in Personal projects Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Minor release tag

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants