Copied to clipboard

Flag this post as spam?

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


  • lori ryan 239 posts 573 karma points
    Apr 29, 2020 @ 14:49
    lori ryan
    0

    Media Picker Images only SVG as allowed image type

    Where can I add svg as an allowed image type when images only enabled on the medida picker.

  • Marc Goodson 2149 posts 14355 karma points MVP 9x c-trib
    Apr 29, 2020 @ 19:08
    Marc Goodson
    2

    Hi Lori

    I think it's a setting in UmbracoSettings.config file called ImageFileTypes

    The default listing is: jpeg,jpg,gif,bmp,png,tiff,tif

    You can see that that value is read in when identifying images in the Umbraco source...

    https://github.com/umbraco/Umbraco-CMS/blob/a9d45413c89d67280ce54c7fd4182e90323bab6c/src/Umbraco.Web/Editors/MediaController.cs#L707

    regards

    Marc

  • lori ryan 239 posts 573 karma points
    Apr 30, 2020 @ 08:19
    lori ryan
    0

    Thanks Marc I will give it a go

  • lori ryan 239 posts 573 karma points
    Apr 30, 2020 @ 09:35
    lori ryan
    100

    Added the below to the umbraco settings file in the content section

    <imaging>
        <!-- what file extension that should cause Umbraco to create thumbnails -->
        <imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif,svg</imageFileTypes>
        <!-- what attributes that are allowed in the editor on an img tag -->
        <!--<allowedAttributes>alt,border,class,style,align,id,name,onclick,usemap</allowedAttributes>-->
        <!-- automatically updates dimension, file size and extension attributes on upload -->
        <!--
        <autoFillImageProperties>
            <uploadField alias="umbracoFile">
                <widthFieldAlias>umbracoWidth</widthFieldAlias>
                <heightFieldAlias>umbracoHeight</heightFieldAlias>
                <lengthFieldAlias>umbracoBytes</lengthFieldAlias>
                <extensionFieldAlias>umbracoExtension</extensionFieldAlias>
            </uploadField>
        </autoFillImageProperties>
        -->
    </imaging>
    
  • Marc Goodson 2149 posts 14355 karma points MVP 9x c-trib
    Apr 30, 2020 @ 11:07
    Marc Goodson
    0

    Yes, that's the one!

  • Gurumurthy 53 posts 126 karma points
    May 16, 2023 @ 07:24
    Gurumurthy
    0

    Hi All,

    How to do this in Umbraco v11 ? need to allow webp images to upload and render along with thumbnails

    Thanks,
    Gurumurthy J V

  • Marc Goodson 2149 posts 14355 karma points MVP 9x c-trib
    May 16, 2023 @ 07:38
    Marc Goodson
    1

    Hi Gurumurthy

    Most settings like this are now settable via appsettings.json

    A complete list is available here:

    https://docs.umbraco.com/umbraco-cms/reference/configuration

    That said, there looks like there is an open 'issue' with setting ImageFileTypes:

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

    in V11, I'm not sure if that stops you doing it, or just mucks up the intellisense.

    regards

    Marc

  • Gurumurthy 53 posts 126 karma points
    May 16, 2023 @ 09:29
    Gurumurthy
    0

    Thanks Marc, I got this setting

    We can set this from content settings as per the link below,

    https://docs.umbraco.com/umbraco-cms/reference/configuration/contentsettings

Please Sign in or register to post replies

Write your reply to:

Draft