473,382 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Remove Image from storage after getting image info

1
Befor uploading Images to Server I want to get the height and width of Images. To do it, I use FileReader.

Expand|Select|Wrap|Line Numbers
  1.   var f = files[i];
  2.   //Item from input files
  3.   var oFReader = new window.FileReader();
  4.   oFReader.readAsDataURL(f);
  5.   oFReader.onload = function (oFrEvent) {
  6.       var res = oFrEvent.target.result;
  7.       var img = new Image();
  8.       img.onload = function () {
  9.          imgList.push({width:img.width, height:img.height})
  10.          img = null;
  11.       }
  12.       img.src = res;
  13.    }
I tried to open over 30 Pictures, size > 3 MB.
After ca. 20 Pictures (i=20) by
img.src=res; i get:
JavaScript runtime error: Not enough storage is available to complete this operation.

How to remove img from storage?
img = null; does not help.

Best regards and thanks
Apr 11 '16 #1
1 3021
gits
5,390 Expert Mod 4TB
never got such a error message - is that occuring in IE? seems there are a few reported issues with IE that throw this error message - seems it can occur in different situations.

can you try another browser to confirm that? since you dont need the image anymore after loading them to check - you could even try to not create a new image object every time and read into the same object. that way you would need to 'serialize' the read tho (read again after loading each image) - which might be a bit slower - but it reads from the local machine so it shouldnt be such a big deal. if its to slow - then you can try to set up 2 image objects that can load simultanously - and increase the number until the error occurs and stick with the number that still works then.
Apr 14 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: amita | last post by:
hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be shown better with 'Kodak Image Control'. 3.To...
3
by: Ryan Sullivan | last post by:
I have been struggling mightily in getting this to work with the scripts I have seen. I have an image map that uses overlib to display information about a school's campus: ...
2
by: Paul Aspinall | last post by:
Hi I am trying to find some code, or reference docs, to assist in helping capture images from an image capture device (ie. webcam etc etc). I want to be able to compare successive images coming...
3
by: Jake | last post by:
I am a beginner in C# and web controls. I need a way to load an image which is stored in an Access (mdb) field into an Image control added at runtime. I get the image (jpg format) dynamically at...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
1
by: Mustafa Rabie | last post by:
dear all, i am writing an application where the user can upload his own picture. I wanted to get the Width and Height of the uploaded picture. So i assigned the uploaded image to an aspnet...
5
by: Bill | last post by:
(I forgot to mention that I'm using C#) ------------------- When communicating with a server via webservices, I need to view and set the timezone information for a simple object (it contains one...
3
by: Paul Cheetham | last post by:
Hi, I have an application that will display user-defined images in some asp:image controls. (sets the ImageURL, and is always built from the site root) The problem comes when the images...
9
by: =?Utf-8?B?RGVubmlz?= | last post by:
I am trying to get all the user info in my home network domain using WMI but the below code returns nothing. I know the domain name I pass is correct, i.e., "mshome". I cut and pasted this code...
0
KalariaNitya
by: KalariaNitya | last post by:
Hello All, in windows application(vb.net) i have one button control i want to relocate that button on Second button's click event. means old location is:184, 111 i want new location :59, 375...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.