Skip to content

Keep ImgBot off the favicon, and document that re-rendering undoes it - #6

Merged
Sukarth merged 1 commit into
mainfrom
docs/og-imgbot-note
Jul 29, 2026
Merged

Keep ImgBot off the favicon, and document that re-rendering undoes it#6
Sukarth merged 1 commit into
mainfrom
docs/og-imgbot-note

Conversation

@Sukarth

@Sukarth Sukarth commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Follow-up to #5.

  • Restores public/favicon.svg to its commented source and adds .imgbotconfig to skip that one file. It is hand-written, and the comments name the brand colours and the size the glyph is drawn to read at, which is worth more than the 300 bytes. The 16 cards, where the real 1.1 MB saving is, stay optimised.
  • Documents the trap in og-render.mjs: re-rendering after ImgBot inflates public/og from 2.6 MB back to 3.7 MB and dirties all sixteen files, because Chrome does not compress as hard. Verified rather than assumed.

No version bump, nothing user-facing.

Summary by Sourcery

Restore the handcrafted favicon SVG while excluding it from ImgBot optimisation, and document the impact of rerunning the OG image renderer after ImgBot recompression.

Enhancements:

  • Preserve the original commented favicon.svg source for readability and brand reference while keeping other image optimisations intact.
  • Clarify in og-render.mjs how ImgBot recompression interacts with regenerated OG images and the expected size changes.

Documentation:

  • Add inline documentation to the OG rendering script explaining ImgBot’s recompression effects and expected diffs when re-rendering images.

Chores:

  • Add ImgBot configuration to exclude the favicon from automatic optimisation.

ImgBot minified favicon.svg, which is hand-written and carries comments naming
the brand colours and the size the glyph is drawn to read at. Saving 300 bytes
is not worth losing those, so restore the source and add .imgbotconfig to skip
that one file. The 16 cards, where the actual 1.1 MB is, stay optimised.

The trap worth writing down: og-render.mjs regenerates at Chrome's compression,
so running it after ImgBot has been through inflates public/og from 2.6 MB back
to 3.7 MB and dirties all sixteen files. Verified, and noted in the script.
Copilot AI review requested due to automatic review settings July 29, 2026 12:55
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ib-econgraph-ai Ready Ready Preview, Comment Jul 29, 2026 12:56pm

@sourcery-ai

sourcery-ai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Restores the hand-authored favicon SVG while configuring ImgBot to ignore it, and documents the interaction between ImgBot and the og image rendering script so reviewers understand why re-rendering changes file sizes and touches all card images.

Flow diagram for og image rendering and ImgBot recompression interaction

flowchart LR
  dev[Developer runs og-render.mjs]
  script[og-render.mjs uses execFile to drive headless Chrome]
  chrome[Headless Chrome renders 16 PNG cards]
  bigpngs[PNG cards at ~3.7 MB total]
  commit[Commit rendered PNGs]
  imgbot[ImgBot PR losslessly recompresses PNGs]
  smallpngs[PNG cards at ~2.6 MB total]

  dev --> script
  script --> chrome
  chrome --> bigpngs
  bigpngs --> commit
  commit --> imgbot
  imgbot --> smallpngs

  rerun[Re-run og-render.mjs after ImgBot]
  inflate[PNG cards return to ~3.7 MB and all 16 files change]

  smallpngs --> rerun
  rerun --> inflate
Loading

Flow diagram for favicon handling with ImgBot configuration

flowchart LR
  favicon[Hand-authored public/favicon.svg with brand colour comments]
  config[.imgbotconfig excludes favicon.svg]
  imgbot[ImgBot image optimiser]
  cards[16 card images in public/og]

  favicon --> config
  config --> imgbot

  imgbot -->|skips| favicon
  imgbot -->|optimises| cards
Loading

File-Level Changes

Change Details Files
Restore the favicon SVG source while preventing ImgBot from re-optimizing it.
  • Revert favicon.svg to the original commented, hand-authored source instead of an ImgBot-optimized version.
  • Preserve brand color and glyph sizing comments within the favicon SVG for future reference.
  • Add an ImgBot configuration file to exclude favicon.svg from automated image optimization while keeping other assets, such as the 16 cards, optimized.
public/favicon.svg
.imgbotconfig
Document ImgBot and Chrome compression behavior in the og rendering script to explain expected diffs and file size changes.
  • Extend the og-render.mjs header comment to describe how ImgBot losslessly recompresses the generated PNGs by ~30%.
  • Note that re-running the script with Chrome increases the total PNG size and rewrites all sixteen card files, which is considered expected behavior.
  • Clarify that Chrome’s rendering output is otherwise deterministic, producing byte-identical files when card content is unchanged.
  • Provide guidance to either commit the larger PNGs and let ImgBot shrink them again or manually re-optimize them before committing.
scripts/og-render.mjs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sukarth, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 414e9470-342b-4035-879b-af2398fd4217

📥 Commits

Reviewing files that changed from the base of the PR and between 41007e0 and d5f5e35.

⛔ Files ignored due to path filters (1)
  • public/favicon.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • .imgbotconfig
  • scripts/og-render.mjs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/og-render.mjs" line_range="16-21" />
<code_context>
  * nobody: no npm package to install, and it resolves system fonts the same way
  * the browser preview does, so what was approved is what gets written.
+ *
+ * NOTE: the committed PNGs have been through ImgBot, which losslessly recompresses
+ * them by about 30% (2.6 MB rather than 3.7 MB). Chrome does not compress that
+ * hard, so re-running this rewrites all sixteen at the larger size and shows up
+ * as a diff touching every card. That is expected. Commit it and let ImgBot
+ * shrink them again in its own PR, or run them through an optimiser yourself.
+ * Chrome's output is otherwise deterministic: rendering without changing a card
+ * produces byte-identical files.
  */
</code_context>
<issue_to_address>
**issue:** Determinism claim may not hold across Chrome/OS/font changes.

This note assumes Chrome always produces byte-identical PNGs, which may not hold across different Chrome versions, OS/font configurations, or hardware acceleration settings. Consider scoping the claim (e.g., "on the same machine with the same Chrome version and font set") or explicitly noting that environment changes can cause diffs even when card content is unchanged.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread scripts/og-render.mjs
Comment on lines +16 to +21
* NOTE: the committed PNGs have been through ImgBot, which losslessly recompresses
* them by about 30% (2.6 MB rather than 3.7 MB). Chrome does not compress that
* hard, so re-running this rewrites all sixteen at the larger size and shows up
* as a diff touching every card. That is expected. Commit it and let ImgBot
* shrink them again in its own PR, or run them through an optimiser yourself.
* Chrome's output is otherwise deterministic: rendering without changing a card

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Determinism claim may not hold across Chrome/OS/font changes.

This note assumes Chrome always produces byte-identical PNGs, which may not hold across different Chrome versions, OS/font configurations, or hardware acceleration settings. Consider scoping the claim (e.g., "on the same machine with the same Chrome version and font set") or explicitly noting that environment changes can cause diffs even when card content is unchanged.

@Sukarth
Sukarth merged commit fd8c34a into main Jul 29, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores a human-readable, commented favicon.svg while preventing ImgBot from re-minifying it, and adds documentation explaining why rerunning the OG image renderer will temporarily inflate and rewrite committed PNG assets.

Changes:

  • Restore public/favicon.svg to the commented, hand-authored source for maintainability.
  • Add .imgbotconfig to exclude the favicon from ImgBot optimisation while keeping OG image optimisation intact.
  • Document in scripts/og-render.mjs that rerendering produces larger PNGs until ImgBot recompresses them again.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
scripts/og-render.mjs Adds documentation about expected diffs/size changes when rerendering OG cards after ImgBot recompression.
public/favicon.svg Reverts favicon to the readable, commented version with brand/color notes.
.imgbotconfig Configures ImgBot to ignore the favicon so the handcrafted SVG stays intact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants