imazen / resizer

The official repository for ImageResizer
http://imageresizing.net/
Other
566 stars 172 forks source link

Not possible to use webp plugin using instructions in documentation #246

Open LinusEkstrom opened 5 years ago

LinusEkstrom commented 5 years ago

I've been trying to get the Webp-pluging to work for a solution based on ImageResizer.Net with an elite license, but can't get it to work. As been mentioned in previous issue, this has a dependency to a non-documentet external assembly. This is available on Nuget as a redistributable version, but for an older version of .NET framework. Regardless, I've gotten hold of a version of libwebp.dll but I'm getting a BadImageException when trying to convert an image from png to webp with the following stack trace:

Imazen.WebP.Extern.NativeMethods.WebPEncodeBGRA(IntPtr bgra, Int32 width, Int32 height, Int32 stride, Single quality_factor, IntPtr& output) +0 Imazen.WebP.SimpleEncoder.Encode(Bitmap b, Single quality, IntPtr& result, Int64& length) +296 Imazen.WebP.SimpleEncoder.Encode(Bitmap from, Stream to, Single quality) +62 ImageResizer.Plugins.WebPEncoder.WebPEncoderPlugin.Write(Image i, Stream s) +126 ImageResizer.ImageBuilder.BuildJobBitmapToStream(ImageJob job, Bitmap source, Stream dest) +306 ImageResizer.ImageBuilder.BuildJob(ImageJob job) +1461 ImageResizer.ImageBuilder.BuildInternal(ImageJob job) +365 ImageResizer.ImageBuilder.BuildInQueue(ImageJob job, Boolean useSemaphore, Int32 maxQueuingMilliseconds, CancellationToken cancel) +115 ImageResizer.ImageBuilder.Build(ImageJob job) +29 ImageResizer.<>cDisplayClass5_0.<HandleRequest>b1(Stream stream) +887 ImageResizer.Plugins.DiskCache.<>cDisplayClass29_0.<TryWriteFile>b0() +496 ImageResizer.Plugins.DiskCache.LockProvider.TryExecute(String key, Int32 timeoutMs, LockCallback success) +393 ImageResizer.Plugins.DiskCache.CustomDiskCache.GetCachedFile(String keyBasis, String extension, ResizeImageDelegate writeCallback, Int32 timeoutMs, Boolean asynchronous) +560 ImageResizer.Plugins.DiskCache.DiskCache.Process(IResponseArgs e) +125 ImageResizer.Plugins.DiskCache.DiskCache.Process(HttpContext context, IResponseArgs e) +61 ImageResizer.InterceptModule.HandleRequest(HttpContext context, HttpModuleRequestAssistant ra, IVirtualFile vf) +1128 ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e) +988 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88

MEmanuelsson commented 5 years ago

We've managed to get it up and running, after a bit of a struggle, on our side maybe 6 months ago. Not sure these are all the bits and pieces that need to be in place but just thought we could compare environments: