Optimize hub images: pjpg CDN renditions and stale cleanup#12
Conversation
Closes #5. fetch_images.py now requests Shopify CDN sources as small progressive-JPEG renditions (width=600&format=pjpg). The store ignores format=webp (it returns the original PNG), so pjpg is the only conversion that takes effect. This drops the six product PNGs from 700-900KB each to 60-85KB, cutting images/ from ~5.2MB to ~840KB. - Save Shopify renditions as .jpg and delete the previous extension so stale .png files do not linger in the repo or the deploy (remove_stale). - Leave non-Shopify sources (msr-1's wiki image) untouched when the file already exists, so its manual resize from #1 is not clobbered by a full-size re-download. - New scripts/test_fetch_images.py (stdlib unittest, no deps) covers the rendition URL building and stale cleanup; wired into the registry CI job. - Regenerated the ten hub images. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (15)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this change?
Closes #5. Shrinks the hub images and stops stale files from lingering.
scripts/fetch_images.pynow requests Shopify CDN sources as smallprogressive-JPEG renditions (
width=600&format=pjpg). I verified empiricallythat the store ignores
format=webp(returns the original PNG) buthonors
format=pjpg(returnsimage/jpeg), so pjpg is the only conversionthat actually takes effect.
images/goes from~5.2MB to ~840KB.
.jpgand the previous extension is deleted, so stale.pngfiles no longer linger in the repo or the deploy (remove_stale).already exists, so its manual resize from Core installer: hub, device wizard, registry, CI #1 is not clobbered by a full-size
re-download.
scripts/test_fetch_images.py(stdlibunittest, no deps) covers therendition URL building and stale cleanup, wired into the
registryCI job.Heads up: this PR includes the regenerated image binaries, so it is worth a
quick eyeball on image quality before merging.
Checklist
cd tests && npx playwright test) (11 passed)cplist in.github/workflows/pages.yml(n/a: images/ is already copied; the new files are scripts/tests, not shipped)devices.jsonchanged:python scripts/validate_registry.pypasses (only image fields changed; validator ran green)🤖 Generated with Claude Code