Copied to clipboard

Flag this post as spam?

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


  • Markus Rytterkull 31 posts 182 karma points
    Oct 11, 2022 @ 13:54
    Markus Rytterkull
    0

    ImageSharp.web not resizing on new web site - what am I missing?

    Hi! Just upgraded a customer from Umbraco 8 to 10 and created a new site to test the upgrade.

    I am using SixLabors.ImageSharp.Web 2.0.2 and on some pages we do the image-resizing directly by adding parameters to the image url, i e "/media/myimage.jpg?mode=pad&width=150&height=90&bgcolor=fff"

    On my machine it works fine and the folder /umbraco/Data/Temp/MediaCache/ contains lots of folders and files.

    On our server, however, images are not resized and the MediaCache folder is empty. No errors in log or event viewer. AppPool is running as local admin.

    I guess I have missed something on our server, but I do not know what?

    Thanks for all suggestions :-) / Markus

    Media-settings in appsettings.json, local and on server:

      "Imaging": {
        "Cache": {
          "BrowserMaxAge": "7.00:00:00",
          "CacheMaxAge": "365.00:00:00",
          "CacheFolderDepth": 8,
          "CacheHashLength": 12,
          "CacheFolder": "~/umbraco/Data/TEMP/MediaCache"
        },
        "Resize": {
          "MaxWidth": 1920,
          "MaxHeight": 1920
        }
    
  • Markus Rytterkull 31 posts 182 karma points
    Oct 12, 2022 @ 16:18
    Markus Rytterkull
    0

    Saw this thread and tried the solution there, same issue. https://our.umbraco.com/forum/using-umbraco-and-getting-started/109573-getcropurl-doesnt-resize-the-image-on-umbraco-10

    Have run locally on release-settings, still "works fine on my machine".

  • Markus Rytterkull 31 posts 182 karma points
    Oct 17, 2022 @ 16:14
    Markus Rytterkull
    0

    After too many hours of changing order of rows in startup.cs and doing random restarts, image-resizing works again. One thing I can't wrap my mind around was that I felt like it went on and off. Worked for a while, stopped working, and then started working again when I requested some other file. I know, this sounds strange, but I could not find the reason for this.

    In the end, this configuration works for me (and I hope this doesn't change): - add this to startup.cs (found this by Anders Löfgren in another post): app.UseWhen(context => !context.Request.Path.StartsWithSegments("/media"), appBuilder => appBuilder.UseStaticFiles()); - delete old web.config from the Media-folder - do not install ImageSharp.Web separately since it is already included

Please Sign in or register to post replies

Write your reply to:

Draft