Fall back when social image Glide fails - #660
Merged
duncanmcclean merged 6 commits intoSep 7, 2026
Merged
Conversation
Skip Glide for gif/svg OG and Twitter images, and use the raw asset URL when generate returns nothing so meta tags still render.
On Statamic 6.31, removing only the home entry still leaves findByUri('/') resolving to another page. Match 7.x and clear the pages collection instead.
edalzell
force-pushed
the
fix/social-image-glide-fallback
branch
from
September 6, 2026 20:30
3afade8 to
bcd0853
Compare
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012QLKhaM7gUc5BeDWysaYBG
evaluate `shouldGlideSocialImage()` once and make the new helpers `private`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012QLKhaM7gUc5BeDWysaYBG
the glide tag already returns the raw asset url for extensions the driver can't handle and drops items it fails to decode, so the template fallback covers both cases without a gif/svg allowlist in the tag. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012QLKhaM7gUc5BeDWysaYBG
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012QLKhaM7gUc5BeDWysaYBG
Member
|
Thanks for the PR. I've pushed up a handful of changes:
I'll merge and tag a release shortly. |
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.
Summary
glide:generatecan't produce a social image, fall back to the raw asset URL soog:image/twitter:imagestill render. This covers formats the configured image driver can't manipulate (e.g. SVG on GD) as well as files that fail to decode.Fixes #659
Test plan
og:imageandtwitter:imagepointing at the raw asset (no/img/asset/Glide URL)og:imageandtwitter:imagepointing at the raw assetvendor/bin/phpunit --filter='social_image'