[For Developers WP8] Save space by avoiding bug in MediaLibrary.SavePicture

Ray Adams

New member
Jul 3, 2012
993
0
0
Just want to open this thread to inform developers in case some of you don't know about it or just starting to develop application.

There is a bug in MediaLibrary.SavePicture function. After executing, MediaLibrary leaves a file in your IsolatedStorage with the name of your picture plus ".jpg" extension.
For example if you save your image like this
Code:
using (var m=new MediaLibrary())
{
    m.SavePicture("New image.jpg",imageStream);
}
You will get file with name "New image_jpg.jpg" in IsolatedStorage. .jpg will be converted to _jpg. It seems developers of WP just trying to fix file name when developer send it as .png or any other extension. Not the elegant way to check actual extension for file, but let it remains on their conscience.
So the best way in this situation is to delete this file to save space on phone. If your application utilizes SavePicture a lot, this could be a problem as your "Other" storage will increase :)

Another suggestion is give the name for your image with .jpg attached, not "My Picture" but "My Picture.jpg" or when other applications read Media library they receive image name without extension which could be a problem if application later search media library by file name.


Microsoft is aware of this bug, but who knows when they fix it.
 
I'm not sure, but this may be fixed with GDR2. There are actually quite a few bugs with that function that will supposedly be addressed by GDR2, but I haven't been able to verify it yet since T-mobile is lagging with their update ^_^
 
I hope they fix it in GDR2. I have it on my 8X (still with me even with 920 on hands) and can test it.
 

Members online

No members online now.

Forum statistics

Threads
339,545
Messages
2,262,574
Members
428,763
Latest member
Yasuyokirari