coderedcorp / coderedcms

Wagtail + CodeRed Extensions enabling rapid development of marketing-focused websites.
https://www.coderedcorp.com/cms
Other
691 stars 133 forks source link

Webp format and Linkedin cards #529

Closed ma00 closed 2 years ago

ma00 commented 2 years ago

Describe the bug

If you post a url with a .webp cover image on linkedin, the image card won't show because the format is not supported.

Expected behavior

Is it possible to get linkedin bot fetch a .jpeg or .png image while still showing the .webp image to regular users?

vsalvino commented 2 years ago

Thanks for reporting. I guess we may have been a bit too aggressive with the webp implementation. As a workaround, you can set the OpenGraph image in the SEO tab for the page. This should render the image in its original format in the opengraph meta tags.

ma00 commented 2 years ago

thanks for the reply. The OG image is still in .webp

<meta property="og:image" content="..../media/images/yes_sign.original.webp">

vsalvino commented 2 years ago

So the issue here is that I think you are uploading the image to Wagtail in webp format. For SEO purposes, we do not transform the image; it is served directly in original format. Can you try uploading it to Wagtail in JPG or PNG format?

ma00 commented 2 years ago

Images are uploaded in JPG format and converted with these settings:

WAGTAILIMAGES_FORMAT_CONVERSIONS = { 'tiff': 'webp', 'jpeg': 'webp', 'bmp': 'webp', 'png': 'webp', 'webp': 'webp', }

vsalvino commented 2 years ago

Ok, that is the problem. You are forcibly converting all file types to webp. I would recommend removing the WAGTAILIMAGES_FORMAT_CONVERSIONS setting. CRX will automatically use webp in places where it is acceptable.

ma00 commented 2 years ago

I removed the lines and now everything started working again, thanks for your help!