Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Sep 16, 2014 @ 07:58
    Bjarne Fyrstenborg
    1

    Upscale default when output image format is png

    I think it was one of the latest versions of Slimsy where upscale is set til false as default. However I noticed when setting output format to png, it does upscale the image by default.

    So with this line:

     <img src="@featureImage.GetResponsiveImageUrl(270, 161, "Image", "png")" alt="" />

    I have to change it to this to avoid upscaling:

     <img src="@featureImage.GetResponsiveImageUrl(270, 161, "Image", "png")&upscale=false" alt="" />

    Futhermore, is there a way to avoid force the output to jpg and use the default format? e.g. I have some  jpg and some png (with transparent background). Perhaps a parameter to handle this?

    /Bjarne

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Sep 16, 2014 @ 10:27
    Jeavon Leopold
    101

    Hi Bjarne,

    Yes we had to switch back to upscale=true because ImageProcessor does not crop if it cannot upscale which leads to warped image results if a request is made for a size larger than the source (I will be seeking a different solution but currently this will have to stay).

    If you add the below to your appsettings in web.config then format will be auto rather than jpg (we changed to jpg as default as it offers the best compression format)

    <add key="Slimsy:Format" value="false"/>
    

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft