Copied to clipboard

Flag this post as spam?

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


  • Wesley Allen 5 posts 25 karma points
    Aug 02, 2021 @ 15:18
    Wesley Allen
    0

    Unable to upload WebP files (v7.12.3)

    I receive the following error when trying to upload a webp file.

    500 error: umbraco/backoffice/UmbracoApi/Media/PostAddFile

    I have installed the ImageProcessor.Plugins.Webp package and the required C++ dll.

    Uploading a webp file works until I add the following to the umbracoSettings.config file.

    <imaging>
     <imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif,svg,webp</imageFileTypes>
    </imaging>
    

    However, without this setting in the config I am unable to select the webp image from the content image selector.

    Is there something I am missing that would allow me to upload a webp file and also add the webp file to content pages?

  • Brendan Rice 538 posts 1099 karma points
    Aug 02, 2021 @ 23:21
    Brendan Rice
    0

    Hey Wesley,

    You might need to add this to your web.config:

    <configuration> 
        <system.webServer> 
            <staticContent> 
                <mimeMap fileExtension=".webp" mimeType="image/webp" /> 
            </staticContent> 
        </system.webServer> 
    </configuration>
    
  • Wesley Allen 5 posts 25 karma points
    Aug 03, 2021 @ 13:28
    Wesley Allen
    0

    I forgot to include in my original post that I also made that change to my web.config. Thank you!

  • Brendan Rice 538 posts 1099 karma points
    Aug 03, 2021 @ 13:34
    Brendan Rice
    0

    Here is a similar issue on GitHub that might help:

    https://github.com/umbraco/Umbraco-CMS/issues/9339

  • Wesley Allen 5 posts 25 karma points
    Aug 03, 2021 @ 18:44
    Wesley Allen
    0

    Thanks for the link, but that did not fix my issue.

    Unfortunately implementing the suggestion from the last post is not an option at this time. Really hoping to find a solution so my marketing team is able to upload webp images.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Aug 03, 2021 @ 19:35
    Jan Skovgaard
    1

    Hi Wesley

    You should be able to allow your content editors / marketing team to upload either .jpg or .png files like they're probably already used to and then when you render the image using ImageProcessor you can use the "format" option to serve the image as .webp.

    Perhaps you can find some inspiration in order how to achieve it by reading Kieron's blog about it in case you have not seen it already - https://kieron.codes/blog/using-webp-images-in-umbraco/

    Jonathan has also written about it here https://www.steadygo.digital/blog/webp-serving-next-gen-image-formats-with-umbraco/

    This way you don't need to burden the editors with converting the images to .webp upfront - You can make it for them on the fly :-) and it takes browsers that don't support .webp into account and ensures they get served .jpg/.png for instance.

    Piotr also has a take on it here https://piotrbach.com/enable-webp-image-format-in-umbraco-cms - Using his approach you can decide whether to render the image as .webp in your views instead not forcing .webp to be rendered for instance.

    Hope this helps!

    /Jan

  • Wesley Allen 5 posts 25 karma points
    Aug 04, 2021 @ 13:13
    Wesley Allen
    0

    Hi Jan. I do like giving the content editors / marketing the ability to continue to upload files they are currently producing, however, they are moving in the direction of actually creating webp formats. I plan on moving forward with the changes outlined in the links you provided, but I also don't want to be a blocker if my team wants to upload a specific type of file.

    Could the issue I am running into be caused by the version of umbraco? We have on our roadmap to upgrade umbraco, and if upgrading could fix this issue I could probably move the upgrade timeline up.

    Thanks for your help.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Aug 06, 2021 @ 10:20
    Jan Skovgaard
    0

    Hi Wesley

    I don't think upgrading Umbraco will help resolve the issue you're dealing with unfortunately.

    Only thing I'm wondering is whether it makes any difference if you remove the mime type before adding it in your web.config? Don't know if you have already tried this?

    <configuration> 
        <system.webServer> 
            <staticContent> 
                <remove fileExtension=".webp" />
                <mimeMap fileExtension=".webp" mimeType="image/webp" /> 
            </staticContent> 
        </system.webServer> 
    </configuration>
    

    If this does not help I'm all out of ideas unfortunately.

    /Jan

  • Wesley Allen 5 posts 25 karma points
    Aug 06, 2021 @ 15:49
    Wesley Allen
    0

    Hi Jan

    Thanks for your assistance, but yes I have tried that as well, and it is still not working.

    I appreciate all the feedback. We will probably move forward with implementing the imageprocessor "format" option to return webp files for now.

Please Sign in or register to post replies

Write your reply to:

Draft