ImageSharp.Web 2.0.0 release? #223
-
Hi When will version 2.0.0 be released of this? :) We just got ImageSharp 2.0.0, but sadly it's not useful for us until ImageSharp.Web has followed up. :D |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Are you kidding me? |
Beta Was this translation helpful? Give feedback.
-
@JimBobSquarePants are you planning on doing a release candidate for v2? Would love to test everything out on a nightly Umbraco 10 build and validate whether everything works and custom providers/processors can be implemented correctly! |
Beta Was this translation helpful? Give feedback.
-
Before releasing the final v2 version, a good exercise would be to check whether it's possible to change the new default configuration to function the same as v1. As far as I'm aware, you'd need the following setup to ensure the same cache folder structure is used, optionally disable EXIF orientation-aware resizing, use the legacy cache key and the services.AddImageSharp(options =>
{
// Set to previous default value of CachedNameLength
options.CacheHashLength = 8;
// Use similar command parsing as in v1
options.OnParseCommandsAsync = c =>
{
if (c.Commands.Count == 0)
{
return Task.CompletedTask;
}
// It's a good idea to have this to provide very basic security
uint width = c.Parser.ParseValue<uint>(c.Commands.GetValueOrDefault(ResizeWebProcessor.Width), c.Culture);
uint height = c.Parser.ParseValue<uint>(c.Commands.GetValueOrDefault(ResizeWebProcessor.Height), c.Culture);
if (width > 4000 && height > 4000)
{
c.Commands.Remove(ResizeWebProcessor.Width);
c.Commands.Remove(ResizeWebProcessor.Height);
}
// Disable EXIF orientation-aware resizing
if (c.Commands.Count > 0)
{
c.Commands.Add(ResizeWebProcessor.Orient, bool.FalseString);
}
return Task.CompletedTask;
});
})
.Configure<PhysicalFileSystemCacheOptions>(options =>
{
// Ensure this value is the same as CacheHashLength to generate a backwards-compatible cache folder structure
options.CacheFolderDepth = 8;
})
.SetCacheKey<LegacyV1CacheKey>()
.ClearProviders()
.AddProvider<WebRootImageProvider>(); |
Beta Was this translation helpful? Give feedback.
-
It's out now. |
Beta Was this translation helpful? Give feedback.
It's out now.