Skip to content

System.Runtime.InteropServices.COMException at PhotoSauce.MagicScaler.WicPlanarCache.loadBuffer #118

Discussion options

You must be logged in to vote

The error code you have there is WINCODEC_ERR_BADIMAGE, indicating the Windows JPEG codec found invalid image data. The most likely cause is simply a corrupted image file, but you may have a concurrency issue somewhere else leading to a corrupted or truncated input stream. Without a full repro, that's the best guess I can make.

This isn't likely related to your error, but in your sample code, CodecManager.Configure() is used incorrectly. That method should be called only once, during application startup. Each time that method is called, the list of codec plugins has to be rebuilt and replaced, which is very expensive to do for each WebP output you create.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@leventefabry-mof
Comment options

Answer selected by leventefabry-mof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #116 on July 19, 2023 18:45.