Developer-Friendly

Microsoft says Windows is developer-friendly

More Money

Developers could earn less with new Windows revenue share

Advertising

Microsoft introduces ad mediation for Windows Phone apps

Developers developers developers!

Devs, responding to reviews boosts your ratings

Developer news!

Respond to customer reviews

Developers

New SDK and Emulators now available for developers

Windows Phone Apps

Windows Phone a target of more than 1/4 of app developers, despite market share

Developers

Developers: Here's how to give users the option for a Transparent Live Tile (Updated)

Developers

Xbox One games to benefit from major graphics boost with new XDK

Software

Internet Explorer Developer Channel offers bleeding edge web experience

Windows Phones

The journey of the Windows Phone platform and state of the ecosystem

Windows Phone Apps

Microsoft launches official #wpdev Windows Phone 8 app for developers

Developers

Low memory devices lead Windows Phone downloads, games are most popular category

Developers

Telerik makes controls free for a limited time in honor of TechEd 2014

Windows Phone Apps

Adobe releases PhoneGap Developer for Windows Phone

Developers

Learn to develop for Windows Phone 8.1 in one weekend with Channel 9

Developers

Windows Phone developer hooks up Cortana to control his lights

Developers

Windows Phone 8.1 and universal apps can now be submitted to the Dev Center

Developers

Microsoft to host new Publish Windows developer days with awesome prizes

Developers

Bookmark this: Microsoft's highlights from Build 2014

< >
145

Developer discovers storage bug when saving images to Windows Phones

Nokia Storage Check

We've covered issues with "Other Storage" fairly extensively in the past, but now we're taking a quick look at a find by Kévin Gosse in his Windows Phone app Imageboard Browser. The app has been causing problems with users as sometimes hundreds of megabytes of data would be stored and taking up valuable space, but this isn't related to other storage so what's going on?

Gosse managed to track the issue to the methods MediaLibrary.SavePicture and MediaLibrary.SavePictureToCameraRoll. Both are utilised when saving images to a Windows Phone's pictures hub. It's reported that each and every time they're used, a copy of said image being saved is also stored in isolated storage.

After creating a small app to test out his theory, Gosse confirms that when an image is downloaded and saved locally, a copy can be detected in isolated storage. It's a bug that can be easily overlooked. Here are more findings:

  • Gosse could not reproduce the bug on Windows Phone 7; only Windows Phone 8 appears to be affected.
  • Various hardware (Lumia 822, Lumia 920, and the emulator) was tested. It's not device-specific.
  • The bug occurs only when saving JPG pictures. Nothing is stored on the isolated storage when saving a PNG picture.
  • If it's anticipated and a file is created beforehand on the isolated storage with the same name, it will be overwritten. If it's locked by keeping the stream open, the MediaLibrary.SavePicture method throws an exception.
  • The MediaLibrary.SavePicture has an overload that expect a byte array rather than a stream. It suffers from the same bug.
  • The name of the file created in the isolated storage is the same name as the one provided to the MediaLibrary.SavePicture, with “.jpg” appended to the end (even if the name already contained “.jpg”), and dots ‘.’ replaced by underscores ‘_’. Knowing this, it’s possible to write code to automatically delete the file.
  • Using Nokia’s storage tool, those files are reported in the application’s dedicated storage. Not in the temp files or the “others” storage.

Note the second-to-last point as Gosse states it's easy to workaround. This can be achieved by automatically removing the temporary file that's created in isolated storage. This could cause serious issues with those who are on low-end hardware and only have limited amounts of internal storage. Something to keep an eye on, developers.

Source: Codes Sources; thanks, Jorba, for the tip!

5
loading...
0
loading...
0
loading...
0
loading...

Reader comments

Developer discovers storage bug when saving images to Windows Phones

145 Comments

Thanks for the info. I was just about to start a new thread asking where the storage space on my poor Lumia 820 has been magically disappearing to.

Out of sheer desperation, I deleted music from SD. Tried to save it back, accidently saved it on phone. It did not fit. Deleted 1 GB from phone and 1 GB from Other Storage. Still stuck with 1 GB on phone with 1.5 free space on Other Storage, back down to 2 GB in Other S.

They know , he talked about it a couple of time before !
I think they mentioned they are working on it & the fix will be with the next update.

Its always with 'the next update', i hate how lazy microsoft is with windows phone, the suggestion box has had the same suggestions for years, do they ever get released. Of course not, makes me wonder why it exists in the first place.

They're slow, yes, but I've had a few of my suggestions released. They can't do them all at once you know!

Why? Far as I know they're one of the oldest, largest, most successful tech company in the world with almost unlimited resources. Even if they selected the top 100 requested features a year ago and assigned a single dev to each feature, they would have been completed already. Their problem isn't one of resources or of process management limitations, its rather one of prioritization. Nokia, who is focused on hardware, has done almost as much, feature wise, for Windows Phone over the past year as Microsoft.

They are slow yes, but that's just because Microsoft doesn't have nearly as big a team for windows phone as for example windows, but with all this recent marketing and apps and stuff I have a feeling they are starting to concentrate more on windows phone, just look at how the support was in 2011 and now

Lol how naive of you, the bigger the corporation is, slower the response is for customer support.

I'm becoming increasingly convinced that Microsoft cares much less about user requested features and fixes than they do about their long term/7 years strategic plans for how Windows Phone fit into their overall ecosystem. It would explain why they slowly trickle out new features that are not on the user voice list while almost totally ignoring the user feedback that they themselves asked for.

Does that include Images we download to the phone via PC (Drag & drop) as well ? Or only pictures we take & ones we download from the internet ?

It appears to be any app calling the referenced methods for saving images. If IE uses those methods to save images, then any jpg saved by IE would be duplicated.
Drag and drop is a different beast altogether. That had to do with USB mass storage and would use a different set of methods to store the files.

I see , Thanks !

Speaking of Mass Storage, Can you switch from MTP to Mass Storage in Windows Phone ?

How is WP8 so much buggier than WP7? I recently went out and took a bunch of pictures on my 920 then when I got home, connected to my WiFi and uploaded those pics to SkyDrive from my phone only for it then to use up all of my phones remaining storage (had around 3.5 gigs remaining).

Been living under a rock this last year? ;-) WP8 is a brand new OS, of which only the 1% that makes up the UI happens to look the same as WP7 did. Brand new = lots of bugs.

no need to be so rude a5cent, his got a valid point anyway mrcraggie try turning off auto upload and cleaning using nokia storage tool after a reboot?
May be that would help presuming you used the auto upload feature, as It looks like the pictures / videos get cached in the temp folder to be uploaded but dont get deleted afterwards. I personally have not had any issues uploading pictures to sky drive via manual select however I don't use auto upload as i prefer to upload the pictures I want and not have all my pictures floating in the cloud.

Too bad I didn't know this before I saved hundreds of pictures with FaceSwap... My other storage is 17 GB :'(

I use auto upload (full quality), and with using Nokia Storage tool once a week or so, my other storage stays around one gig.

It's not a bug. WP only allow you to save jpg image.  Other image types (gif and png) are not supported but can be done by other image libraries like imagetools.
Reading png image data is not the problem in WP.

well whatever the case is, its NOT normal! this should of been resolved right away once MS got reports of this...abnormality.

They should never have released a phone with such a ridiculous amount of storage. 4 gigs, really htc???

I'd like to report another "bug". Please fix and improve the mess that is Xbox Music. Its not only a major headache when managing music on our PC's, there are plenty if issues when using Music on our WP8 devices as well.

Will you kindly elaborate? I've purchased my first ever windows phone about a week ago (Nokia Lumia 928), and I'm in love with it! Windows XP currently powers my desktop. I use Windows Media Player 11 to sync Music to my Lumia. It works flawlessly. Album art, track info, and the whole nine. I also ensure that all of my music are in .mp3 format (Makes creating ringtones a walk in the park).

Most likely he wont. The problem has nothing to do with micro sd card. Its actually related to xbox music trying to write correct attributes (album, artist, genre, etc) to your music files in cases where it 'feels' they are incorrect. I also read somewhere that it also has to do with xbox music pass and syncing of music on the cloud.
Fortunately in my country the music pass service is not available, so that takes care of the second problem and for the first one I prefer to arrange my music library through iTunes, even manually updating values where required. That takes care of it.
I am currently using a 920 as well as a 720 and never even once come across this issues of multiple files. And yes i transfer music to the sd card as well.

As long as the files are in mp3 format and the file attributes are proper, music should,sync across correctly, including album art, track info and the whole nine. :)

The software on the PC is a headache to use. Making playlists on the phone can be done, but again, more of a pain than it should be. Playing music on the phone is bad as well. I have the music pass and often there are long delays when it tries opening a new song while shuffling.

All of my mp3/wma's have correct metadata, they work great. But I have almost 10,000 songs on my 64GB SD card and not having playlists is BS (except smartlists made on the phone - hardly worth it).

On WP it's fine (I actually like it better than Zune) Windows 8 Xbox music absolutely sucks though, it's like worse than IE6...

It's TRUE...
I experienced the same like issue in my lumia 820.
Steps to reproduce the issue:
1. Make Windows Phone to save pictures in SD card in Photo settings.
2. Download apps or load content so that phone memory becomes full.
3. Try to take a picture using Camera.
4. It will ask to you to clear internal memory even though you have opted to save pictures in SD card.

I think WP stores a copy in both phone memory and SD Card.

I've to reset my phone more than 3 times in a month because of this stupid Other Storage bug.
@Microsoft make apps to be installed in SD card. We ran out of memory very soon.

This happens with official YouTube app (Thank god it has been pulled) the video get cached into my Nokia Lumia 602's other memory.Removing the app doesn't free it

I've noticed that too...pictures and videos it seems like gets duplicated. I've verified this...sat around watching multiple YouTube videos and it literally ate up my other storage...

Thanks for sharing. It was driving me crazy trying to figure out where my storage was going. Looks like I'll be updating YouTube back to the original.

I noticed a problem with ProShot. The storage taken by this app is 400mb right now. The pictures are stored to the sd card but the space consumed by proshot gets higher with every picture i take. I think this problmen is related to the bug. Can someone confirm that?

Yep!  Actually, here's the full story:

I alerady patched the bug the article mentions in ProShot. It will automatically remove the temporary files left behind by the function MediaLibrary.SavePictureToCameraRoll() when the user exits the program.

This same fuction will leak huge amounts of memory per picture saved under some really easy to reproduce conditions. This memory leak will eventually cause apps to crash ( the bug directly affects the stability of ALL Lenses apps). According to the last post here: http://social.msdn.microsoft.com/Forums/en-US/wpdevelop/thread/7d79ac8e-da65-4491-af8a-5efcd873b88e a fix should be coming soon.

More recently, I've discovered that when an app crashes, the system leaves behind a .tmp file that never seems to get removed. Many users who have had ProShot for a while will notice that the app is still consuming memory, and this is the reason. This will be patched in v2.7 (coming in the next few days).

I have been so frustrated with this...i have an 810 and half of my storage is used up in other storage!..i have been wrecking my brain trying to figure out what the heck is in other storage..

No, T-MO won't release the app for the Lumia 810 in the states - which is really frustrating me again with them.  This other storage issue is a serious inconvenience - not a problem with current usage but a problem for future apps/usage - and Microsoft is failing to provide an acceptable solution.  Nokia, is trying its best but they shouldn't be responsible for repairing this OS problem.  T-MO is extremely dissapointing because they refuse to help 810 owners, just like they refused to offer 7.8 for 710 owners.  This is pathetic.  - So to restate my response to your inquiry the answer is No, unfortunately.

To everyone complaining, I understand your pain but I think we ought to know by now that you better have a lot of patience with Microsoft. We have to wait.

Yeah, and after 6 months of loving my Lumia I'm thinking about going back to iPhone because Microsoft just doesn't seem to care. Apple's far from perfect but at least they care about their customers :-(

To be fair, this Other storage bug isnt just an inconvenience. If you've got a WP8 phone 8 gb or less, it pretty much renders the phone all but unusable. Almost everyone in that category has factory reset their phones at least once. So it's kind of a serious issue.

Certainly is, but acting like Apple is so much better is pointless. If that's the way they feel then why not have an iPhone.

I came from iPhone to WP. I LOVE WP. I want to keep using WP, it's the best mobile OS I've ever used. But this storage issue is so huge, and Microsoft just doesn't seem to care that maybe I have to go back to the second best mobile OS if the big 8.1 doesn't change things. I need to actually be able to use my smartphone, not just love it to bits.

Feel ya there. Been stressing this for so long. I've got 0 games installed, all media files in SD. Couple essential apps installed and I've got under 1GB left. (Other 4GB + System 2GB). It's ridiculous. It's another story if apps can be installed in the SD card, but it isn't.

And yes I've done everything the forum and internet suggests to do.

I won't be buying a Windows Phone, unless and until Microsoft fixes this.
I love WP, but if MSFT doesn't fix this and some feature requests (top ideas in uservoice), I will have to satisfy myself buying an Android Nexus 4.

I've taken photos, deleted them, then synced to my PC only to find that the deleted images were magically synched too.

Great...another storage bug to worry about. :( I had no idea about this one...this is definitely not good with the new Lumia additions and the new camera update that's coming soon to Lumias. Ppl are going to want to take lots of pics, especially in low light! :(

Gosse..kudos to u mate..thats quality work, something nokia or microsoft should be doing. :D still, the least they could do now is take a note and fix this soon.. :))

If they don't fix this bug I'm gonna switch to a HTC One or Galaxy S4 seriously. Microsoft seems to think it's users will put up with anything and will never leave the platform

When you buy a 820 and it becomes useless after a month, thoughts like that do cross your mind. It's a serious issue that shouldn't be ignored TBH. 

Galaxy also has a severe storage problem. Perhaps not leaking memory this fast but they have their own "other storage" problems.

Very interesting. I'd like to see what comes of this. I wonder if it has anything to do with uploading/backing up to SkyDrive.

Man these comments are getting tiresome. Useless whiners killing the valid content. Go back to your IOS or Android. Best of luck! Learn to be more patient, the updates will come.

You sound like the type who will just "take it" because they say you have to. These are valid complaints and they should be heard/read all over. If not things may never change. And change is always needed in life. And definitely needed for this OS we all love to use.

Yeah, I'm sure the CEO is reading these butt hurt comments and taking them to heart.
Some clowns talk like there have never been bugs/issues with iPhone & Androids... if they are so great why did you even try a WP? And why are people with 'droid' and 'iphone' in their name even posting here? TROLLS

There should be a third party app to help remove the "other" files. I have about 8gb taken up by other almost out of memory!

I just want a other storage fix my phone has 7gb of other wtf!!!! I only have like 14 to use so other is 50%

I tried emptying all the system picture folders. Moved all pics into a folder called our pics. Since i did it my other folder shot down and temp storage did the same. Theley are now manageable simply by moving the pics every now and again.

the folders i emptied were
camera roll
saved pictures
screenshots

try it and see if it works for you.

ps I'm on a lumia 820

No sorry should have been more clear. They still on my phone just in a folder on it called our pics. Ie an album created through my laptop and all the transfer has to be done from laptop. Move all photos from the above mentioned folders to a new folder called whatever u want.

Seems to for me. My storage is still quite small but i have loads of apps so its expected. Other is about steady 800mb and temp which was stuck at 800mb now goes down to 200 when cleared using storage check in settings.

2 more things. Auto upload is turned off, i read that it affects it somehow

and i was using the lumia storage check app but now use the settings storage check option. Don't know if that helped but I'm sticking to it

Hi, thank you for this information! Worked like a charm. I've dropped a few posts here and there based on this information as your solution seems to be the only one to work. Just copying the post over at forums. Okay, I seem to have got the point and the workaround to this issue. The trick below worked like a charm for me. The Other category dropped from 2.93 Gbytes to a tiny 81.79 Mbytes just in a single restart.
CAUSE
The Camera Roll app has a defect that leads the JPG files (it seems to be the only extension affected) to be duplicated to the IsolatedStorage folder for the Camera Roll app each time the app calls a method that has something to do with JPG files, such as SavePictureToCameraRoll. //I may be wrong in exact reason but there seems to be a bug in Camera Roll.
SOLUTION

  1. Plug the phone to the PC.
  2. Create a custom folder on the storage such as, for example, Photos Computer\Samsung ATIV S\SD card\Photos

WARNING This folder will be used to store JPG files moved from Camera Roll's default folder. Importantly, you won't miss your moved photos in the Photos app on the Start screen. The phone periodically scans your storage for presence of JPG files no matter where they are and what is the name of the folder they are stored in and adds the discovered folder to the folder list of Photos app.
NOTE Depending on the whether the phone comes with SD Card or it has internal storage only, you have to open either Phone or SD card node in the file manager on Windows PC.

  1. Open the .\Pictures\Camera Roll\ folder such as
  2. Computer\Samsung ATIV S\SD card\Pictures\Camera Roll
  3. Select all the JPG files in the Cameral Roll folder by pressing Ctrl+A and cut the pictures from there by pressing Ctrl+Z.
  4. Return to the custom created folder Photos and paste the cut pictures to there by pressing Ctrl+V. This will move all the JPG files from the Camera Roll folder to the custom Photos folder.
  5. Restart the phone by pressing the phone's power button and sliding the screen down to confirm the shutdown. When the phone is turned off, start it again. Check the Other storage when Windows is started.
  6. Mine Other has dropped by 2.8 Gbytes and now shows 81.79 Mbytes (!)

Did u disable the skydrive auto upload? Also try moving the files on sky drive. If auto upload was on then there will be a photos folder on your skydrive containing the same picture folders i described above.

create a new folder in skydrive NOT in the pictures or photos folder and move the uploaded photos to there. Make sure auto upload is off on ur phone and see if that works?

This developer needs an award for deep diving into a bug so thoroughly for Microsoft.

Does anyone still have the links that refer to "We've covered issues with "Other Storage" fairly extensively in the past", I want to read it, is it here on WP Central?

Dear Diary. 
My 820 has been useless the past couple months because I need to be paranoid about when my 800MB storage will be eaten. I play no games because I have 0 installed (most "exclusive" games won't even install). I have a couple photos and music in my SD card. Everything auto is turned off. I installed a couple apps (forgive me) so I can CHAT with my friends and find my way around some places. I hope this is not a sin.  I use my phone to check mail, call others, text others.....check mail...call others............text others................che...............
Dear Diary
I've done everything the internet told me to. Shrink storage the hell out of it. Storage utility. I tried killing the temporary files but somehow they revive. My phone is infested with 4GBs of OTHER storage and 2GB from the system itself. I cannot kill it. I cannot install apps on my card. I should've known better with 8GBs but who knew 6GB of it would invade my property?

Dear Diary
This is the last straw. Yes I am whining. To myself. But I know I have the right to. When you buy a brand new SMARTphone that doesn't allow you to do anything to it after a month because you've only got a couple hundred MB's left with NOTHING on your phone it wrecks you.

Dear Diary............

Storage check says I've 2GB of media and files in phone memory even though all my pictures, music and videos are stored in SD card. I can't install any big games now :(

Still waiting on the storage app and update to begin with. Doubt I'll see this fix any time soon.

This makes sense. I found it odd when I was running out of space on my 8X even after cleaning up my apps, games and music...still 2g left.