Copied to clipboard

Flag this post as spam?

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


  • Jason 122 posts 637 karma points
    Jan 17, 2017 @ 02:49
    Jason
    0

    ImageProcessor not working with UmbracoFileSystemProviders.Azure

    I am having an issue getting ImageProcessor to work with images stored in an Azure Blob. I am using the latest version of the UmbracoFileSystemProviders.Azure plugin installed via nuget. The images are retrieved from the blob but none of the ImageProcessor query string parameters will work on the images.

    i.e. http://localhost:12345/media/16058/image1.jpg?crop=0.040796245837117766,0,0.041288222827732549,0&cropmode=percentage&width=50&height=367&rnd=130875544740000000

    This url was outputed by the GetCropUrl method. The full sized image is returned and not the cropped image. The blob container is public. Images are being cached just not processed. No broken image but the crops are being ignored.

    I have this at the end of my main web.config:

      <imageProcessor>    
        <security configSource="config\imageprocessor\security.config" />
        <caching configSource="config\imageprocessor\cache.config" />
      </imageProcessor>
    

    Here is my security.config:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
        <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value="media-myclient"/>
            <setting key="MaxBytes" value="8194304"/>
            <setting key="Timeout" value="30000"/>
            <setting key="Host" value="http://myaccount.blob.core.windows.net/media-myclient"/>
          </settings>
        </service>
      </services>
    </security>
    

    Is the RemoteImageService service required or does the CloudImageService service handle relative urls so that I don't need to add the remote.axd to the url? The GitHub read me for the plugin does not show it but other posts do. If so, is the whitelist section required?

    Here is the cache.config with DiskCache set:

    <?xml version="1.0" encoding="utf-8"?>
    <caching currentCache="DiskCache">
      <caches>
        <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365">
          <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings>
        </cache>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey" />
            <setting key="CachedBlobContainer" value="cache-client" />
            <setting key="UseCachedContainerInUrl" value="false" />
            <setting key="CachedCDNRoot" value="https://myaccount.azureedge.net/" />
            <setting key="CachedCDNTimeout" value="1000" />
            <setting key="SourceStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=mykey" />
            <setting key="SourceBlobContainer" value="media-client" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
      </caches>
    </caching>
    

    I understand that putting the cache into the blob/CDN is better, but is it mandatory for this to work with ImageProcessor providers? Or have I just missed something here? Thanks.

  • Casper Stendal 11 posts 31 karma points
    Jan 20, 2017 @ 14:23
    Casper Stendal
    0

    Hi Jason,

    It sound like your CDN is not fully deployed (needs up to 90 minutes): https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/82351-imageprocessor-not-working-with-umbracofilesystemprovidersazure

    enter image description here

    I get very impatient every time I sets up a new CDN. :)

    /Casper

  • Jason 122 posts 637 karma points
    Jan 31, 2017 @ 19:24
    Jason
    0

    Thanks Casper but I am not actually using the CDN at this time. I can get images from the blob but my issue now is that ImageProcessor is handling all image requests and if there is not a query string value at the end of the image url I am getting this error:

    Value cannot be null.
    Parameter name: querystring
    

    ImageProcessor wants the query string to be able to look the image up in the cache but if there is no query string it cannot add the image to the cache. Sort of a chicken and the egg thing.

  • Rodske 74 posts 104 karma points
    Feb 15, 2017 @ 04:58
    Rodske
    0

    It's not the most elegant solution, but we just ended up with Url Rewrite rule:

    <rule name="Image Handler fix" stopProcessing="true">
          <match url="^media/(.*)\.(jpg|gif|jpeg|png){1}$" />
          <conditions>
            <add input="{QUERY_STRING}" pattern="[^.]" negate="true"/>
          </conditions>
          <action type="Redirect" url="/media/{R:1}.{R:2}?anchor=center&amp;mode=crop&amp;rnd=" appendQueryString="false"/>
        </rule>
    
  • Vidar Solberg 7 posts 145 karma points
    Mar 02, 2017 @ 12:27
    Vidar Solberg
    1

    I got this same problem after an upgrade (7.4.2 to 7.5.10), and it also messed up the serving of design files located in the local web folders (like /content/images/*.png).

    But I found out that a small downgrade did the trick. It seems like ImageProcessor.Web is the problem, but v.4.7.2 is working fine. It requires maks 7.5.7 of Umbraco so it's definitly a temporary solution, but with the following versions, it works (as far as I can see):

    <package id="ImageProcessor" version="2.5.2" targetFramework="net451" />
    <package id="ImageProcessor.Web" version="4.7.2" targetFramework="net452" />
    <package id="ImageProcessor.Web.Config" version="2.3.0.0" targetFramework="net451" />
    
    <package id="UmbracoCms" version="7.5.7" targetFramework="net452" />
    <package id="UmbracoCms.Core" version="7.5.7" targetFramework="net452" />
    

    You also need to remove the trimCache attibute from <caches><cache ... trimCache="false"> in the file /Config/imageprocessor/cache.config.

    -Vidar

  • Vidar Solberg 7 posts 145 karma points
    May 22, 2017 @ 12:33
    Vidar Solberg
    101

    This issue is fixed in ImageProcessor.Web version 4.8.3, so an NuGet update will now solve this.

  • Ronen Rimon 22 posts 124 karma points
    Feb 21, 2020 @ 07:49
    Ronen Rimon
    0

    I also had to update UmbracoFileSystemProviders.Azure to ver. 1.1.0 and it solved the problem

  • Mario Lopez 168 posts 952 karma points MVP 4x c-trib
    Oct 16, 2017 @ 00:49
    Mario Lopez
    0

    I'm having exactly this issue, but I'm using: Umbraco 7.7.2 ImageProcessor.Web 4.8.6

    I'm not using CDN at all, is this a requirement?

    Any ideas?

    Thanks.

  • Paul Gower 28 posts 74 karma points
    Apr 02, 2018 @ 14:11
    Paul Gower
    0

    I am using Umbraco 7.10.0 and ImageProcess.Web 4.8.7 and not able to test this after adding azure blob storage for the media folder.

    Does ImageProcessor work on your local machine? I wonder if that is it. I haven't pushed my changes to the server yet so if testing ImageProcessor locally isn't possible that could be my issue.

    However, I would imagine you could test ImageProcessor locally...or would hope you could!

  • Paul Gower 28 posts 74 karma points
    Apr 02, 2018 @ 16:54
    Paul Gower
    1

    I figured out my issue and it was with my config file.

    I had set the prefix attribute to /media rather than media/ like a goofball!

    Hope this helps someone else!

  • Hugo Becerra 12 posts 82 karma points
    Jun 17, 2020 @ 07:42
    Hugo Becerra
    0

    You saved my life :) Thanks!

  • Jeffrey Weinstein 67 posts 313 karma points
    Jul 14, 2019 @ 20:09
    Jeffrey Weinstein
    0

    I installed ImageProcessor as well as ImageProcessor.Web.Plugins.AzureBlobCache and also UmbracoFileSystemProviders.Azure

    So I have this

    <img src="@Url.GetCropUrl(person.Photo, 323, 300)" />

    that will generate

    https://localhost:44311/media/nttbu3dg/7659_10156684436130184_4967892355748601119_n.jpg?anchor=center&mode=crop&width=323&height=300&rnd=132076081419230000

    but the croping is not happening,

    this is my package.config

    https://pastebin.com/4bSjZ2td

    it's

    Umbraco version 8.1.0,

    UmbracoFileSystemProviders.Azure version 2.0.0-alpha2

    ImageProcessor.Web.Plugins.AzureBlobCache version 1.5.0.100

    Anybody knows whats wrong? Please help..

  • Mike Chadwick 41 posts 182 karma points
    Mar 04, 2020 @ 16:36
    Mike Chadwick
    0

    Hi,

    I am also having similar issues.

    Umbraco v8.4.1. UmbracoFileSystemProviders.Azure version 2.0.0-alpha5 ImageProcessor.Web.Plugins.AzureBlobCache version 1.5.0.100

    Crops just don't seem to be being generated correctly. Did you find any resolutions for this?

    Thanks

    Mike

  • Paul 184 posts 646 karma points
    Oct 12, 2020 @ 12:12
    Paul
    2

    I had this recently, my issue was that I'd created the media folder on Azure and it's default pubic access level was "no public access" changing that to "public read access for blobs only" resolved it.

  • Alan Mitchell 57 posts 281 karma points c-trib
    Sep 20, 2021 @ 10:06
    Alan Mitchell
    0

    This solved the same issue for me. Thanks for posting!

    The confusing part is that if the ImageProcessor plugin can't load the image from Azure it seems to fall back silently to the AzureBlobFileSystem (which uses a connection string rather than public blob access). So you get the basic image file, but with none of the crops or processing.

  • Sergejs Kravcenko 1 post 21 karma points
    Feb 22, 2021 @ 11:18
    Sergejs Kravcenko
    0

    Hi guys,

    I'm having similar issue, I'm using this package https://github.com/Bjornmamman/Our.Umbraco.AutoImageOptimze Locally works fine as expected with latest version of UmbracoCms 8.11.1 However once migrated to azure blob storage using UmbracoFileSystemProviders.Azure.Media Files are fetched fine, but never in webp extension, tried query params format=webp, all the same; enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft