Home

Share via:

LinkedIn Does Not Support WebP

LinkedIn has not yet implemented support for WebP in preview images of articles.

74 views

Edited: 2020-05-30 08:43

While there are certainly aspects of LinkedIn that I find useful, it is also hard not to notice that they do not, yet, support the webp image format. If you use webp in your articles and attempt to share them on LinkedIn, the image-preview will simply not work; instead you might see unrelated images being used as preview—or no image will be shown at all!

This situation is far from ideal.

Of course, LinkedIn is not the only ones falling behind in this area. Apple's Safari web browser also does not support the webp format yet; to great disappointment of web developers users alike.

The webp format was introduced almost 10 years ago, so the fact that it is still not implemented by some of the biggest players is, worrying. The webp format offers far superior compression than the traditional png and jpeg formats, and better compression equals faster website load speeds.

Because of this situation, web developers will be forced to deliver jpg or png versions of images to clients that do not yet understand the webp format. Personally I have not yet done this, which means that users visiting my sites in these inferior web browsers simply will not see any images; I think this is an acceptable solution, and if more people was thinking in this way, it just might force the developers to finally update their software with support for modern image formats and web standards.

If someone at LinkedIn is reading this, please update your website to include support for webp image files—thank you! :-D

Alternative image formats

If a client supports the WebP format, it should be included in the accept HTTP request header as image/webp. If not included, we could instead convert the image to jpg or png and deliver that back to the client instead.

Doing so will however mean that files ending in .webp is going to be delivered with a mismatching Mime Type for clients that do not accept webp. This is also very problematic, since it might confuse our users into thinking that the files are webp, when in fact they are either jpg or png.

To solve this problem, we could add a temporary redirect for the .jpg or .png version of the files. But, this assumes that you either have access to the server configuration, or that your images are delivered through PHP.

We may check if the accept header contains "webp" with the strpos function, using this below code:

if (false !== strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
  echo '<b>image/webp</b> is supported!';
  exit();
}

Knowing this, we can just convert the image and deliver an alternative format. However, instead of simply delivering the alternative file directly, resulting in a mismatch between the content-type and the file extension, I suggest you save the file and redirect the client. This would avoid the usability problem of mismatching file extensions.

Comments