Developer discovers storage bug when saving images to Windows Phones
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!
Windows Central Newsletter
Get the best of Windows Central in your inbox, every day!
Rich Edmonds was formerly a Senior Editor of PC hardware at Windows Central, covering everything related to PC components and NAS. He's been involved in technology for more than a decade and knows a thing or two about the magic inside a PC chassis. You can follow him on Twitter at @RichEdmonds.
I think they mentioned they are working on it & the fix will be with the next update.
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.
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.
Reading png image data is not the problem in WP.
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.
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.
@Microsoft make apps to be installed in SD card. We ran out of memory very soon.
And an update is coming early next week that will work around this issue. Read comment #648 at http://forums.wpcentral.com/windows-phone-apps/215564-26.htm#
Amazing how Apple made an absolutely perfect phone right out of the gate.
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.
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
screenshots try it and see if it works for you. ps I'm on a lumia 820
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 Plug the phone to the PC. 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. Open the .\Pictures\Camera Roll\ folder such as Computer\Samsung ATIV S\SD card\Pictures\Camera Roll Select all the JPG files in the Cameral Roll folder by pressing Ctrl+A and cut the pictures from there by pressing Ctrl+Z. 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. 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. Mine Other has dropped by 2.8 Gbytes and now shows 81.79 Mbytes (!)
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...............
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............
2GB of memory occupied by Other storage