Copied to clipboard

Flag this post as spam?

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


  • Alexander Croner 71 posts 282 karma points
    Nov 09, 2018 @ 08:51
    Alexander Croner
    0

    Some images doesn't get cropped

    Hello!

    I have a very interesting problem which is really confusing me.

    I'm looping through a bunch of images and printing them out like this:

    <img src="@(image.Url)?width=200&height=200&mode=crop">
    

    The issue is that some images doesn't get cropped at all. I've even tried with:

    <img src="@img.GetCropUrl(height:200, width:200,useCropDimensions:true)"/>
    <img src="@img.GetCropUrl(height:200,width:200)"/>
    <img src="@img.GetCropUrl(height:200)"/>
    

    What am I missing? I've attached a picture that I'm not getting cropped somehow.enter image description here

    EDIT: Tested this on a clean install. Seems to work there. Might be some issue with UmbracoFileSystemProviders.Azure...

  • Travis Schoening 47 posts 173 karma points
    Nov 09, 2018 @ 17:39
    Travis Schoening
    0

    Can you post what you have in your config files?

    config > FileSystemProviders.config

    config > ImageProcessor > security.config

    config > ImageProcessor > cache.config

  • Alexander Croner 71 posts 282 karma points
    Nov 13, 2018 @ 07:52
    Alexander Croner
    0

    Filesystemproviders.config:

    <Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
    <Parameters>
        <add key="containerName" value="media"/>
        <add key="rootUrl" value="http://127.0.0.1:1000/devstoreaccount1/"/>
        <add key="connectionString" value="UseDevelopmentStorage=true"/>
        <add key="maxDays" value="365"/>
        <add key="useDefaultRoute" value="true"/>
        <add key="usePrivateContainer" value="false"/>
    </Parameters>
    

    Security.config:

    <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>
      </whitelist>
    </service>
    

    Cache.config:

    <caching currentCache="DiskCache">
      <caches>
        <cache trimCache="false" name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" memoryMaxMinutes="1" browserMaxDays="7">      
        <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings></cache>
      </caches>
    </caching>
    

    I'm assuming ive configured something wrong...?

  • Alexander Croner 71 posts 282 karma points
    Nov 13, 2018 @ 14:02
    Alexander Croner
    0

    Okay I updated my security config following the instructions here: https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure

    But to no avail... I must be missing something obvious. And why does some images crop but not other?! So weird!

  • Travis Schoening 47 posts 173 karma points
    Nov 13, 2018 @ 14:07
    Travis Schoening
    0

    I see you're using Azure Blob Storage and also trying to use Dev Storage. Do you have Azure Storage Explorer? Are your files found in there? Have you verified that the emulator has been started?

    Check out this page for more info on that if there's any question about that...

  • Alexander Croner 71 posts 282 karma points
    Nov 13, 2018 @ 14:18
    Alexander Croner
    0

    Yes, the files are stored in the emulator and the emulator is started - I have validated that with the storage explorer.

    But I'm not sure where the cached files are supposed to end up in the blob...? Can't seem to find any of that in the blob...

  • Travis Schoening 47 posts 173 karma points
    Nov 13, 2018 @ 14:20
    Travis Schoening
    100

    In your security.config, I believe you're missing a node for a CloudImageService service.

  • Alexander Croner 71 posts 282 karma points
    Nov 13, 2018 @ 14:52
    Alexander Croner
    0

    Yeah that was it.

    When I tried to add it I had missed a 0 in the port.

    Why some images worked and not others was because of cached images in App_Data cache :)

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft