profile: serve README photos as JPEG instead of WebP - #2
Open
adaptcom[bot] wants to merge 1 commit into
Open
Conversation
WebP is not in GitHub's documented set of supported image formats (PNG, JPG, GIF, SVG), so rendering was client-dependent. Re-encode the four photos as progressive JPEG and repoint the README.
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.
Follow-up to #1.
Diagnosis first
The links on
mainare not broken. I re-rendered both surfaces in a headless browser and all four images decode:Raw URLs return
200withcontent-type: image/webp, and*.githubusercontent.comis in github.com's CSPimg-src.The broken images were almost certainly seen in the PR diff of #1, before it merged: the README pins absolute
raw.githubusercontent.com/.../main/...URLs, but the files only existed on the branch at that point, so they 404'd. Browsers cache image 404s, so a hard refresh clears it. That chicken-and-egg is inherent to main-pinned absolute URLs, and relative paths are not an option because they don't resolve on the org profile page.What this PR actually changes
WebP is not in GitHub's documented supported formats (PNG, JPG, GIF, SVG). It happens to work in current desktop web, but it's unsupported surface area for the mobile apps and third-party renderers. This re-encodes all four as progressive JPEG and repoints the README. Layout is untouched.
Also downscales the oversized originals: hero to 2000px, banner to 1600px, tiles to 1200px. 936KB -> 1.1MB (JPEG is less efficient than WebP, but these are now correctly sized rather than 2558px).
Note: the images will 404 in this PR's diff too, for the same reason as above. They resolve once merged.