Copied to clipboard

Flag this post as spam?

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


This forum is in read only mode, you can no longer reply
  • Bear 40 posts 129 karma points
    Nov 29, 2014 @ 01:50
    Bear
    4

    Quick Tip - Umbraco 7.2.0 (RC) & Remote Images

    Presuming you want use the awesomeness of ImageProcessor (included in 7.2.0), here are some hints on getting this working with Umbraco 7.2.0 (RC) anyone that might be struggling.


    Open your PM Console in Visual Studio and go;

    PM> Install-Package ImageProcessor.Web.Config

    This will update your ~/web.config and will add several new files in ~/config/imageprocessor/

    Then browse to ~/config/imageprocessor/security.config.

    Open it and ensure it has the following remote image service section;

     <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
      <settings>
        <setting key="AllowRemoteDownloads" value="true" />
        <setting key="MaxBytes" value="4194304"/>
        <setting key="Timeout" value="3000"/>
        <setting key="RemotePrefix" value="/remote.axd"/>
      </settings>
      <whitelist>
        <add url="https://i.vimeocdn.com/"/>
      </whitelist>
    </service>
    

    Here I added the keys AllowRemoteDownloads and RemotePrefix. I also had to <whitelist /> the CDN I wanted to use.

    Then, over in my view;

    <img src="~/[email protected]?mode=crop&width=600" />
    

    (where Model.Video.ImageUrl was a string something like https://i.vimeocdn.com/video/474774013_1280.jpg)

    That should do it.

    You then need to buy @jamesmsouth a beer.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Nov 29, 2014 @ 17:23
    James Jackson-South
    2

    Love it! :)

    Just a quick amend.

    The remote prefix setting isn't needed and allow remote download setting also isn't, just the presence of the service in the setting will allow it. If you want to change the prefix value just set the prefix property in the opening declaration.

    <service prefix="CHANGE_ME_TO_WHATEVER_YOU_WANT" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web"> 
    

    Also yeah, beer is great.

Please Sign in or register to post replies

Write your reply to:

Draft