-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Letterbox transforms. notably for social sharing (but I'd argue should be the defaut mode...) #1337
Comments
This would be a great addition. |
Understand that this is part on SEOmatic's end, and part on the service's end in terms of how it crops things. But I'll see what I can do! |
Can one of you provide me with an actual original image that you feel isn't cropped the way you want it to be? |
I added Letterbox as a transform method in the above commits. If you can provide me with an image that still isn't quite doing what you want it to be doing, I can go from there to try to tweak things. Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop as 3.5.6”, Then do a ….. Craft CMS 4: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop-v4 as 4.1.6”, Then do a ….. Craft CMS 5: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop-v5 as 5.1.6”, Then do a |
Ok so that works in the control panel (i.e. scales them down to a proper 'fit'). They are still black padded which I find bizarre (why not white?? I suppose that's a Craft issue though?) I don't suppose there is an easier way than manually going through my 30 odd Content SEO sources and changing those manually from Fit -> Letterbox in the CP is there? That be some tedious clicking...! Hope you're well Andrew! Thanks for digging up this ancient request... |
Without a proper support for fit image, it's basically impossible to use existing image content (e.g. a product's master image) in an appropriate way for social shares - i.e. none of the Craft transform modes produce the desired result of an actual image fit.
Craft, since 4.4, offers a new 'Letterbox' transform mode, that is akin to 'fit image' in most image processing programs, i.e. both the height and width are made to fit within the given bounds.
Craft chooses to pad this image it seems, and for reasons I can't really understand, seems to default to padding with black.
I hacked support into
facebook-og-image-partial.twig
:This improves things a lot, but needs white padding (by default), possible selectable - and isn't quite all the way there, if the preview is accurate:
'Fit' selected:
'Letterbox' selected - I am unsure why this still gets cropped TBH:
It would be really great to have a solve for this issue, it's been bugging me for years now - every time I see a share of one of our things go past and the image is all messed up, it makes an SEO fairy somewhere fall out of the sky, and die.
The text was updated successfully, but these errors were encountered: