내 사이트에 이미지 업로드 버튼이 있습니다. 이것이 내가 원하는 방식입니다.
2와 3 사이의 단계에 대한 도움이 필요합니다. FileReader API를 사용하여 이미지를 선택했을 때 바로 표시하는 문제는 base64로 인코딩 된 src 속성을 얻는다는 것입니다. 그리고 내가 사용한 이미지 자르기 플러그인은 src=""
속성을 유효한 것으로 인식하지 못하기 때문에 이미지에서 제대로 찾거나 초기화하거나 그릴 수 없습니다 .
1-4 단계를 어떻게 달성 할 수 있습니까? 확실히 이것은 Facebook과 같은 주요 사이트에서 이전에 수행 된 적이 있습니까?
http://html5.sapnagroup.com/demos/dragDropUploadsCrop/ 이 링크는 원하는 것을 안내합니다. http://html5.sapnagroup.com/2012/08/preview-and-crop-before-upload/
Files with following extensions are only allowed
allowedExtensions: ['gif','jpg','jpeg','png','txt'],
showCropTool: 1,
sizeLimit: 10737418240, // Maximum filesize limit which works without any problems is 30MB. Current limit is set to 10MB = 10 * 1024 * 1024
params: {
'uploadedBy': 'Sapnagroup',
'x1': '0', // x coordinates of the image
'y1': '0', // x coordinates of the image
'x2': '300', // x coordinates of the image
'y2': '150', // y coordinates of the image
'cWidth': '300', // required crop width
'cHeight': '150', // required crop heignt
'oWidth': '800', // width of the crop preview image
'oHeight': '600', // height of the crop preview image
'rWidth': '300', // resize width
'rHeight': '150' // resize height
},
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다