Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexSizeError: Index or size is negative or greater than the allowed amount #194

Open
rizaldimaulidia opened this issue Nov 29, 2016 · 1 comment

Comments

@rizaldimaulidia
Copy link

Hi,
I got this error when I try to validate an image. whether the image has the shape of the face or not.

IndexSizeError: Index or size is negative or greater than the allowed amount

this is my code to check that image :

$("#nama_file").change(function(){
		var preview = $("#gambar_preview");
		
		preview.fadeOut();
	
		var oFReader = new FileReader();
		
		oFReader.readAsDataURL(document.getElementById("nama_file").files[0]);
		
		$("#loading").show();
		
		oFReader.onload = function (oFREvent) {
			preview.attr('src', oFREvent.target.result).fadeIn();
			
			preview.faceDetection({
				complete: function (faces) { 
					$("#loading").hide();
					
					var hitung = faces.length;
					
					if (hitung < 1){
						preview.hide();
						
						$("#pesan-error").fadeIn().delay(5000).fadeOut(function(){
							preview.attr("src", "images/avatar.png").show();
						});
						
						$("#btn_reset").click();
					}
				},
				error:function (code, message) {
					alert('Error: ' + message);
				}
			});
		};
	});

That code will execute when user click Browse in input type file. Please tell me what wrong with my code. Thank you very much.

Best regards,
Rizaldi Maulidia Achmad

@cinder92
Copy link

@rizaldimaulidia i have the same issue, after refresh to many times the browser it works correctly.

Have you implemented correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants