Search code examples
c#codecpixelformat

FormatConvertedBitmap - No imaging component suitable to complete this operation was found error


I'm using code below for converting an RGB tif file to CMYK format. It works great on my local development machine(Windows 7) but is throwing this error in our Windows 2003 production server.

Error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [NotSupportedException: No imaging component suitable to complete this operation was found.] System.Windows.Media.Imaging.FormatConvertedBitmap.FinalizeCreation() +376 System.Windows.Media.Imaging.FormatConvertedBitmap.EndInit() +158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Below is the code I'm using: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap(); newFormatedBitmapSource.BeginInit(); newFormatedBitmapSource.Source = myBitmapSource; newFormatedBitmapSource.DestinationFormat = PixelFormats.Cmyk32; newFormatedBitmapSource.EndInit(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I've done some research and some people suggested to check the WindowsCodecs.dll version. I did that and found out in my dev machine the version is 6.1.7600 while the server version is 6.0.5840. I tried copying the newer version into the server and registering via regsvr32 but I'm getting "entry point dllregisterserver not found". I tried searching the windowsCodecs 6.1 installer but cannot find any.

How can I update WindowsCodecs.dll in the server? Am I heading in the right solution to this issue? Any input will be greatly appreciated.

Thanks


Solution

  • Turned out the server has some issues (file corruption) and needs to be rebuild.