For more than one scenario, the developer might want to have access to the pictures stored in the device photo hub. That can be done in two ways - either by using PhotoChooserTask which is the most common way to retrieve the image content, given that the user himself will select the single entity that needs to be read, or with the help of MediaLibrary - an XNA sub-layer that allows direct access to the media directory.

The minor gotcha comes when you try to retrieve the file by name. Take, for example, the Baconit app - a reddit client for Windows Phone that also allows its users to store images that are displayed through it.

Let's now say that I want to get the file that I just saved through one of my own applications, using PhotoChooserTask. Using the standard routine:

You can see that for some files, the extension is present (for those that are represented through the full path) and for some - its missing. One should not assume that an extension in this case should be simply concatenated with the core file name - this is bound to cause problems in situations where the developer does not know that is the original file format. For example, it could be BMP, PNG, GIF or JPEG - these are, obviously, not interchangeable.

The solution to this, if you need to obtain files without an extension, would be to place those files in the isolated storage once obtained through the chooser task, and then retrieve them from there instead of relying on the XNA sub-layer for this.