Search code examples
.netvb.netwindows-server-2008windows-server-2008-r2wic

WIC CreateDecoderFromStream returning 0x88982F50 post server migration


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.


Solution

  • 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)