Regenerate image derivatives that img.mjs had been skipping - #3316
Closed
enf0rc3 wants to merge 1 commit into
Closed
Regenerate image derivatives that img.mjs had been skipping#3316enf0rc3 wants to merge 1 commit into
enf0rc3 wants to merge 1 commit into
Conversation
img.mjs only processes a source image when it has no metadata sidecar, so once a sidecar exists without its derivatives nothing regenerates them. Three images were stuck that way: - releases/timeline/environment-timeline.png and -button.png were renamed from timeline.png, and the sidecar came along with the source, so the derivatives kept the old name and the sidecar kept the old image's dimensions - 1000x535 recorded against an image that is 1644x1081 - api-and-integration/github/github-connections-authorize-app.png had a sidecar and no derivatives at any size, which is the state you get when the unawaited toFile calls in img.mjs lose the race with process exit Deleting the three sidecars let img.mjs write the missing files. Nothing references the old timeline-*.webp derivatives; they are left in place rather than widening this to a cleanup. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
borland
requested changes
Aug 6, 2026
borland
left a comment
Contributor
There was a problem hiding this comment.
This PR is redundant when my cleanup PR merges. There's no value in regenerating the image derivatives in the meantime because nothing references them
|
Pull request environment is available at https://stoctodocspr3316.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
Contributor
Author
|
Not required as #3281 fixes the need and we will use the new approach |
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.
Split out of #3313, where these files were surfaced. They fix a pre-existing gap in the asset pipeline and stand on their own.
The trap
img.mjsonly processes a source image when it has no metadata sidecar:Once a sidecar exists without its derivatives, nothing regenerates them. Three images were stuck that way.
What was stuck
releases/timeline/environment-timeline.pngand-button.pngwere renamed fromtimeline.png. The sidecar travelled with the source, soimg.mjsskipped both, the derivatives kept the old name, and the sidecar kept the old image's dimensions — 1000×535 recorded against an image that is actually 1644×1081. Any consumer trusting those numbers was laying out the wrong box.api-and-integration/github/github-connections-authorize-app.pnghad a sidecar and no derivatives at any size. That's the state you get whenimg.mjsexits mid-write: itstoFile()calls at lines 105, 111, 116, 147 and 152 are never awaited, while the sidecar write at line 130 is.What this does
Deletes the three stale sidecars so
img.mjsreprocesses them, and commits the 12 derivative files it produced plus the three corrected sidecars.The old
timeline-*.webpderivatives are unreferenced now, but I left them rather than widening this into a cleanup.Not fixed here
toFile()calls.img.mjscarries a header saying it comes from Astro Accelerator and local edits get overwritten, so the race wants its own decision..jpegsources.img.mjswrites.jpgderivatives whilegetDestinationbuilds the fallback URL from the original extension, so/docs/i/x/…jpegnever exists for the threeprojects/dashboardimages. Replace the magnify-and-new-tab figure with an inline lightbox #3313 handles this by falling back to the original file.Verifying
Nothing references these paths on
maintoday —getImageInforuns for:img{}directives only, and none of these images use one. Somainstays green either way; this makes the assets correct for anything that starts requesting them.🤖 Generated with Claude Code