image loading with windowscodecs

Vincent Povirk madewokherd+8cd9 at gmail.com
Thu Jul 9 13:32:22 CDT 2009


So I've been working on an implementation of windowscodecs.dll
(Windows Imaging Component). This is a Vista/.NET 3.x API for
manipulating image data. To the best of my knowledge, only 2 programs
currently use it, and I'm not running either one. We're not likely to
see it used by real programs in Wine much, since there's no
redistributable. A program using it would have to require Vista or
.NET 3.0, or require users to download it manually.

It's documented here:
http://msdn.microsoft.com/en-us/library/ms735422(VS.85).aspx

Adding this dll will not increase compatibility, at least not
directly. It will, however, provide Wine with a single component that
can be used by any dll or program that needs to load or save a raster
image. All of the code for png, gif, jpeg, etc should be migrated into
this dll. If we need any image formats not supported by native, we can
implement them as Wine-specific extensions.

We need to do this because oleaut32 (the current home of image-loading
code) sucks. I have been told that the libpng code should not be
duplicated throughout the codebase. I need features in gdiplus that
oleaut32 does not provide, such as access to the image dpi and
metadata, and the ability to save images. In fact, much of the gdiplus
image/bitmap api matches WIC 1:1. On Windows, gdiplus is known to be
able to use WIC extensions to support new image types, so in theory it
should use WIC (though this probably won't matter any time soon).

I'm told that image loading is also useful for d3dx9 dll's.

The WIC api is well-designed in my opinion and should be able to
provide any operations needed by other components to load/save images.

The next step is to implement the image types needed by oleaut32 and
start using WIC to load them in olepicture, starting with BMP.

To that end, I need a good test program. I need to see what kind of
BMP files currently work (I suspect that many are broken) and what
kinds will work if I replace the BMP-loading code. This will tell me
at what point I can make the change without introducing a regression.
After that, I'll need to do the same thing with the other file types.
So I need a general-purpose image viewer that uses either gdiplus or
oleaut32 to do its image loading. Does anyone know any?

-- 
Vincent Povirk



More information about the wine-devel mailing list