I am trying to modify this project for showing images in a directory. But the problem is that the code does not work for all images like this one. So the problem is
BitmapFrame bitmapFrame = BitmapFrame.Create(new Uri(path))
Here on the repository BitmapFrame.Thumbnail property is null for some images. I don't find anything about what's wrong with those images.
How to make it work for all images?
I ran into this same issue with the SDK example. Some jpg's are shown as a small white rectangle, instead of a thumbnail. Maybe this is the result of JPG's in an unsupported format, or JPG's not containing EXIF information in the header ? I am not sure.. I could solve it with the procedure Raviraj provided.
However, the answer Raviray provided is a bit short.. the thumbnail only works, when the result of the function is passed into the BitmapFrame constructor of your image class. The BitmapFrame class has a constructor with two arguments for that, the second one is the thumbnail bitmap, see How to override(use) BitmapFrame.Thumbnail property in WPF C#?
I got it working with "bad" jpg's, changing Photo.cs in the SDK example, as follows..