Error Index_size_err Dom Exception 1
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Indexsizeerror Javascript
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags javascript runtime error indexsizeerror Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, indexsizeerror ie11 helping each other. Join them; it only takes a minute: Sign up Uncaught Error: INDEX_SIZE_ERR up vote 11 down vote favorite 7 I am drawing on a canvas with the following line: ctx.drawImage(compositeImage, 0, 0, image.width, image.height, i,
Indexsizeerror: Dom Exception 1
j, scaledCompositeImageWidth, scaledCompositeImageHeight); This code has executed error free on Safari, Chrome, Firefox (and even IE using google's excanvas library). However, a recent update to Chrome now throws the following error: Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 This code often positions part or all of the drawn image OFF the canvas, anyone got any idea what's going on here? javascript google-chrome canvas drawimage share|improve this question edited May 27 '10 at 19:30 Justin Johnson 21.8k74478 asked
Html2canvas Indexsizeerror: Index Or Size Is Negative Or Greater Than The Allowed Amount
May 27 '10 at 17:58 Gart 56113 add a comment| 4 Answers 4 active oldest votes up vote 20 down vote Is compositeImage pointing at a valid (fully loaded) image? I've seen this exception happen if you try to draw the image before it has loaded. E.g. img = new Image(); img.src = '/some/image.png'; ctx.drawImage( img, ..... ); // Throws error Should be something like img = new Image(); img.onload = function() { ctx.drawImage( img, .... ); }; img.src = '/some/image.png'; To ensure the image has loaded. share|improve this answer answered Jun 2 '10 at 17:56 jimr 8,70612430 2 In my case i was trying to copy image with more size that it had - i.e. my sprite image had 100px, and i tried to copy 25px starting from 80px pos, when i fixed image size to be 105px all started to work. –llamerr Oct 26 '12 at 12:20 add a comment| up vote 8 down vote Why? It happens if you draw the image before it is loaded because that is what the html5 2dcontext draft specifies for interpreting the first argument of drawImage(): If one of the sw or sh arguments is zero, the implementation must raise an INDEX_SIZE_ERR exception. sw, sh being source-image width and height @jimr's answer is good, just thought it would be relevant to add this here. share|improve t
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta 0x800a139e javascript runtime error indexsizeerror Discuss the workings and policies of this site About Us Learn
Script5022 Indexsizeerror
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://stackoverflow.com/questions/2923564/uncaught-error-index-size-err you, helping each other. Join them; it only takes a minute: Sign up Javascript INDEX_SIZE_ERR: DOM Exception 1 Error for ranges up vote 5 down vote favorite Using the following code, I get a INDEX_SIZE_ERR: DOM Exception 1 error on the thisRange.setStart line. The code is meant to go through a whole page, find instances of the http://stackoverflow.com/questions/3937678/javascript-index-size-err-dom-exception-1-error-for-ranges searchString, and then add a link in front of that search string. For example, if it finds 5 instances of the string, right now it will add the link in front of the first one but then error on the second and stop, leaving four words without the link. Any ideas? if(searchString.length > 0) { // make sure the string isn't empty, or it'll crash. // Search all text nodes for(var i = 0; i < textNodes.length; i++) { // Create a regular expression object to do the searching var reSearch = new RegExp(searchString,'gmi'); // Set it to 'g' - global (finds all instances), 'm' - multiline (searches more than one line), 'i' - case insensitive var stringToSearch = textNodes[i].textContent; while(reSearch(stringToSearch)) { // While there are occurrences of the searchString // Add the new selection range var thisRange = document.createRange(); //alert((reSearch.lastIndex - searchString.length) + " <-> " + reSearch.lastIndex); thisRange.setStart(textNodes[i], reSearch.lastIndex - searchString.length); // Start node and index of the selection range thisRange.setEnd(textNodes[i], reSearch.lastIndex); // End node an
Sign in Pricing Blog Support Search GitHub This repository Watch 363 Star 7,014 Fork 1,586 niklasvh/html2canvas https://github.com/niklasvh/html2canvas/issues/183 Code Issues 494 Pull requests 51 Projects 0 Wiki Pulse Graphs New issue Uncaught Error: IndexSizeError: DOM Exception 1 #183 Open switer opened this Issue Mar 27, 2013 · 18 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 10 participants switer commented dom exception Mar 27, 2013 Uncaught Error: IndexSizeError: DOM Exception 1 when it execute ctx.drawImage(canvas, bounds.left, bounds.top, bounds.width, bounds.height, 0, 0, bounds.width, bounds.height); while my code want to html2canvas.render a display:none element; What causes this error ? The error track : (anonymous function) html2canvas.js:2828
_html2canvas.Renderer html2canvas.js:2552
options.complete html2canvas.js:2667
start html2canvas.js:2082
img.onload Owner niklasvh commented dom exception 1 Mar 28, 2013 What browser are you using? Which version of html2canvas? switer commented Apr 2, 2013 html2canvas 0.4.0 and chrome 25.0.1364.172 m @windows nbashaw commented Apr 3, 2013 I got this error too. Here's my code: el = document.createElement('div'); el.innerHTML = '