Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 631 posts 1018 karma points
    Apr 08, 2021 @ 17:53
    Dan Evans
    0

    WebP / IE11 / ImageProcessor / IIS Rewrite

    I'd like to use ImageProcessor to serve WebP images - i've installed the necessary plugin and works great. Problem is that WebP doesn't work in IE11 and we still need to support the browser

    I think the best way around this would be to use an IIS Rewrite to parse querystrings for format=webp and replace it with format=jpg when the user agent is MSIE but I have no idea how to create that rewrite.

    Thanks!

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Apr 08, 2021 @ 18:27
    Marc Goodson
    1

    Hi Dan

    Could you use the Picture element to serve your image?

    <picture>
      <source srcset="img/awesomeWebPImage.webp" type="image/webp">
      <source srcset="img/creakyOldJPEG.jpg" type="image/jpeg"> 
      <img src="img/creakyOldJPEG.jpg" alt="Alt Text!">
    </picture>
    

    Example stolen from @Soren in this thread:

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/94579-how-to-use-webp-format-with-the-image-processor#comment-300798

    regards

    Marc

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Apr 08, 2021 @ 18:34
    Søren Kottal
    1

    Thanks for mentioning, @Marc.

    @Dan, you can also handle it serverside - shown here by Kieron https://kieron.codes/blog/using-webp-images-in-umbraco/

    I prefer the picture tag though :)

  • Dan Evans 631 posts 1018 karma points
    Apr 09, 2021 @ 07:25
    Dan Evans
    0

    Thanks for these suggestions - both are really useful. I went for the server side solution as it's an existing site and it minimised code changes.

Please Sign in or register to post replies

Write your reply to:

Draft