[1/5] windowscodecs: Implement QueryCapability in the PNG decoder.

Vincent Povirk madewokherd at gmail.com
Mon Nov 19 09:21:55 CST 2012


You should at least look at the stream and check that it looks like an
image in a format the decoder can read.

For PNG, you could maybe argue that given a correct magic number and a
correctly-working decoder, the decoder must be able to read all the
images or either the decoder or image is broken. Then again, you're
not even checking the magic number..

For TGA, though, we don't have an exact magic number. It's entirely
possible that we our TGA magic number matches some files that aren't
really TGA images but are images in some other format that we can
decode. We need QueryCapabilities to disambiguate the decoders in
these cases.

For JPEG and TIFF, which are extensible formats, there's also the
possibility that an image has something in it that we don't support
(and that the corresponding decoder on Windows doesn't support) but
some other decoder on the system can.

The method should also invalidate the decoder object, so we don't
accidentally introduce code that reuses it.



More information about the wine-devel mailing list