Could you test the attached patch? It builds with libpng 1.2 and seems to work, but I'd like to verify that it also solves the problems with 1.4.
If it's not too much trouble, I'd like you to also test the functionality.
There's a program at http://code.google.com/p/winezeug/source/browse/trunk/appinstall/tools/image... that tests the ability to load images. It can be invoked as "wine imagetest.exe filename.png".
In particular, I'd like to know whether the following two files from the png test suite (http://www.libpng.org/pub/png/pngsuite.html) work:
* http://www.libpng.org/pub/png/PngSuite/basn4a16.png - This is a grayscale png with an alpha channel. That's the situation where we use the png_set_gray... function that was removed.
* http://www.libpng.org/pub/png/PngSuite/x00n0g01.png - This is a broken png file. It will trigger an error. The program should print "GdipLoadImageFromFile returned 1" when loading this file (rather than crashing).