Copied to clipboard

Flag this post as spam?

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


  • Colin Webber 3 posts 73 karma points
    Oct 23, 2019 @ 16:12
    Colin Webber
    0

    ImpageProcessor with AzureBlobCache not cropping images with GetCropUrl

    I'm having some trouble getting ImageProcessor to apply crops properly while using a CDN with AzureBlob Cache. The CropUrls are generated so I believe the CDN is properly being used and the cache busting mechanism is functional, it just won't actually crop the image and returns the full size image instead.

    Umbraco Version: v8.2.0

    Versions of NuGet packages:

    ImageProcessor : v2.7.0.100

    ImageProcessor.Web : v4.10.0.100

    ImageProcessor.Web.Config : v2.5.0.100

    ImageProcessor.Web.Plugins.AzureBlobCache : v1.5.0.100

    UmbracoFileSystemProviders.Azure : v2.0.0-alpha3

    UmbracoFileSystemProviders.Azure.Media : v2.0.0-alpha3

    Releveant Config Files:

    Cache.Config

    <?xml version="1.0" encoding="utf-8"?>
       <caching currentCache="AzureBlobCache">
      <caches>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365" browserMaxDays="7" folderDepth="6" memoryMaxMinutes="1">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;" />
            <setting key="CachedBlobContainer" value="cache" />
            <setting key="UseCachedContainerInUrl" value="true" />
            <setting key="CachedCDNRoot" value="https://cdn-***.azureedge.net/" />
            <setting key="CachedCDNTimeout" value="1000" />
            <setting key="SourceStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;"/>
            <setting key="SourceBlobContainer" value="media" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
      </caches>
    </caching>
    

    Security.Config

    <?xml version="1.0" encoding="utf-8"?>
    <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <add url="https://cdn-***.azureedge.net/" />
            <add url="https://***.blob.core.windows.net/" />
            <add url="https://***.com" />
            <add url="http://localhost" />
            <add url="http://127.0.0.1" />
          </whitelist>
        </service>
        <service prefix="media/" name="AzureImageService" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureImageService, ImageProcessor.Web.Plugins.AzureBlobCache">
          <settings>
            <setting key="StorageAccount" value="DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;" />
            <setting key="Container" value="media" />
            <setting key="AccessType" value="Blob" />
            <setting key="Host" value="https://***.blob.core.windows.net/" />
          </settings>
        </service>
      </services>
    </security>
    

    <img src="@Model.GetCropUrl(propertyAlias: "backgroundImage", cropAlias: "Image", quality: 90, imageCropMode: ImageCropMode.Crop, useCropDimensions: true, cacheBuster: true)" />
    

    Any insights into what I may be doing wrong would be greatly appreciated.

    Thank You

Please Sign in or register to post replies

Write your reply to:

Draft