Open miteyema opened 11 years ago
Surrounded with try/catch block to catch the error. One possible solution is to resize the picture before storing.
In fact, maximum size of localStorage and sessionStorage is 2,5 MB on Chrome, and also on iPad and iPhone (see http://dev-test.nemikor.com/web-storage/support-test/)
The picture that was taken with the camera of the Nexus 7 is of a resolution 960x1280. It is successfully converted to base64. When storing it in the session storage, depending on the size of the picture, the console outputs the following error:
This is because the picture is to large to hold in the session storage. If more than 2 local expenses are stored in the local storage, the local storage also exceeds the limit.