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

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

Open
LinusEkstrom opened this issue May 21, 2019 · 1 comment
Open

Comments

@LinusEkstrom
Copy link

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.<>c__DisplayClass5_0.<HandleRequest>b__1(Stream stream) +887
ImageResizer.Plugins.DiskCache.<>c__DisplayClass29_0.<TryWriteFile>b__0() +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
Copy link

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:

  • ImageResizer.Plugins.WebP.dll version 4.2.5 in bin-catalogue
  • Imazen.webp.dll version 10.0.1 in bin-catalogue
  • libwebp.dll version 0.6.0 in bin-catalogue
  • in web.config
  • Not sure this extra step is needed on a local development machine if you're running VS and stuff but on our test- and production-environments we also had to install "Microsoft Visual C++ 2015 Redistributable", maybe verify that this is installed locally if that's where you're facing the problems.

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

No branches or pull requests

3 participants