I have a thumbnail generation routine that I created using WIC for a .NET app. It has been working fine for the past year, but we just migrated to a new server.
Old Server was W2k8 R2 Enterprise SP1 New Server is W2k8 Standard SP1
Here's the code that is failing
Public Sub New(ByVal PictureData As Byte())
Me.WICFactory = New WICImagingFactory()
Dim InputStream As IWICStream = WICFactory.CreateStream()
InputStream.InitializeFromMemory(PictureData, PictureData.Length)
InputDecoder = WICFactory.CreateDecoderFromStream(InputStream, Nothing, WICDecodeOptions.WICDecodeMetadataCacheOnDemand)
'^===== This line throws the HRESULT 0x88982F50
I have checked and the picture data is valid data. The exact same picture works fine if I run the code on the old server.
That's WINCODEC_ERR_COMPONENTNOTFOUND. It means WIC was not able to find a Decoder class that is registered for the type of file in your stream.
Here is what I would suggest:
On the old server where it works, print out the value of InputDecoder.GetDecoderInfo().GetCLSID(), and maybe also GetAuthor/GetFriendlyName. If it's one of the builtin CLSID's listed here, then the WIC on your new machine is likely broken. Otherwise, you will need to figure out where the decoder you're using on the old machine came from, and install it to the new machine.
Or just look around for a decoder for whatever type of file you have.
The problem was that I was running Server 2008 SP1. As described in this question, you need to apply a platform update to Server 2008 (post SP2) before WIC is available. (It is available natively in R2)
Windows of Previous version Windows Vista SP2 /Server 2008 SP2 + KB971644. does not have GUID_ContainerFormatWmp so it fails to detect image format automatically.
we shoud use the following code.
CoCreateInstance(CLSID_WICWmpDecoder,NULL, CLSCTX_INPROC_SERVER,IID_IWICBitmapDecoder,(LPVOID*)&inputDecoder);
来源:https://stackoverflow.com/questions/10811229/wic-createdecoderfromstream-returning-0x88982f50-post-server-migration