Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot get Slimsy and AzureBlobStorage #81

Open
khraibani opened this issue Oct 29, 2024 · 2 comments
Open

I cannot get Slimsy and AzureBlobStorage #81

khraibani opened this issue Oct 29, 2024 · 2 comments

Comments

@khraibani
Copy link

I cannot get Slimsy and AzureBlobStorage to work together.

Followed these instructions to configure - https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/

Media is uploaded correctly but when rendered the original image is always returned regardless of the crop/quality/format parameters we use.

What we expect is an image returned matching the parameters requested.

For example:
https://xxxx.azureedge.net/media/bdxppozj/steve-halama-grw8xnnx4qm.jpg?rxy=0.7722735494210942,0.6297253454943595&width=30&height=20&quality=40&v=1db294eca131e00
Should return a 30x20 jpeg with quality 40.

What actually gets returned is the original image.

CDN settings in Azure: 'Query string caching behaviour' option has been set to "Cache every unique URL'"

appsettings.json
"Umbraco": { "Storage": { "AzureBlob": { "Media": { "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=;AccountKey=;EndpointSuffix=core.windows.net;", "ContainerName": "media-prod", "MediaPath": "", "UsePrivateContainer": false, "AutoCreateContainer": false } }, "Cdn": { "Url": "https://cdn.azureedge.net/", "RemoveMediaFromPath": false } }, "CMS": { "Global": { "Id": "8eb1f6ce-0ec6-4628-879f-7f644016da76", "SanitizeTinyMce": true }, "Content": { "AllowEditInvariantFromNonDefault": true, "ContentVersionCleanupPolicy": { "EnableCleanup": true } } } }, "Slimsy": { "WidthStep": 180, "UseCropAsSrc": true, "DefaultQuality": 70, "Format": "", "BackgroundColor": "white", "AppendSourceDimensions": true, "EncodeCommas": true, "AutoOrient": true },
Startup.cs
` public void ConfigureServices(IServiceCollection services)
{
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
.AddAzureBlobMediaFileSystem()
.AddAzureBlobImageSharpCache("cache")
.AddCdnMediaUrlProvider()
.AddSlimsy()
.Build();
}

    /// <summary>
    /// Configures the application.
    /// </summary>
    /// <param name="app">The application builder.</param>
    /// <param name="env">The web hosting environment.</param>
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        app.UseImageSharp();

        app.UseUmbraco()
            .WithMiddleware(u =>
            {
                u.UseBackOffice();
                u.UseWebsite();
            })
            .WithEndpoints(u =>
            {
                u.UseInstallerEndpoints();
                u.UseBackOfficeEndpoints();
                u.UseWebsiteEndpoints();
            });
    }`

_ViewImports.cshtml
@using Umbraco.Extensions @using Umbraco.Cms.Web.Common.PublishedModels @using Umbraco.Cms.Web.Common.Views @using Umbraco.Cms.Core.Models.PublishedContent @using Microsoft.AspNetCore.Html @using Slimsy.Enums @using Our.Umbraco.GMaps @addTagHelper *, Slimsy @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Smidge @addTagHelper *, OurHtagEditor @inject Smidge.SmidgeHelper SmidgeHelper @inject Slimsy.Services.SlimsyService SlimsyService @using Slimsy.Extensions

Umbraco 13.5.1
Slimsy version 5.1.2
Umbraco.StorageProviders 13.1.0
Umbraco.StorageProviders.AzureBlob 13.1.0
Umbraco.StorageProviders.ImageSharp 13.1.0

Thanks!

@Jeavon
Copy link
Owner

Jeavon commented Oct 29, 2024

Hello, first question is if you visit the the non CDN'd url with the same querystring do you get the expected resized image?

@khraibani
Copy link
Author

khraibani commented Oct 29, 2024

Hello, yes the image loads at the expected size.
I have purged the cache etc, no luck -
As a side note I remember having the same issue back in Umbraco v8 days with Image Processor that I had to set some parameters in the the config files.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants