2015-01-20 2 views
0

7,043 starsGithub에 대한 유용한 오픈 소스 라이브러리 인 DropzoneJS을 사용하기 시작했습니다. 그것은 이미지 미리보기와 함께 드래그 앤 드롭 파일 업로드를 제공합니다. Firefox에서 다음과 같은 오류에 100,000이 결과보다 더 큰DropzoneJS - IndexSizeError : 인덱스 또는 크기가 음수이거나 허용 된 양보다 많습니다.

그러나 업로드 이미지 : 다음 줄에서 자랐어요

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

에서 dropzone.js :

다른 사람이 경험하고보고

return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh/vertSquashRatio); 
작은 이미지 생성을위한이 동작은 here입니다.

이것은 약간의 연구 끝에 Firefox에서 자주 나타나는 오류입니다. 대부분의 관련 유래의 질문 :

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

답변

1

이 빠른 fix를 수행 한 후에도 내 문제를 해결.

는 기본적으로 교체 :

return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh/vertSquashRatio); 

으로 :

return ctx.drawImage(img, Math.round(sx), Math.round(sy), Math.round(sw), Math.round(sh), Math.round(dx), Math.round(dy), Math.round(dw), Math.round(dh)/vertSquashRatio); 

에서

+1

dropzone.js 그냥 오늘 우리가 동일한 문제를 가지고 감사의 말씀을 원하고 수정 치료 ^^ – azzy81

+0

을 일 내 @SubstanceD 소식을 듣고 기쁘다. – AmirHd

관련 문제