I am using WPF to load an image in the background using the answer at Stackoverflow: How do I load images in the background?
The problem is the URL string could be PNG, GIF or JPG and I need to use either JpegBitmapDecoder, PngBitmapDecoder or GifBitmapDecoder If the correct decoder is not used then a FileFormatException occurs.
I could use the extension on the string but errors could still occur if the user has a GIF image with a .png extension.
Any ideas how I would resolve this issue?