Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn that croppic is the front-end cut, and the cut image data is sent back to the PHP background, then, the background saves the data as an image and generates a reference link to return it to the foreground.
Croppic + PHP Remote upload and cropping code:
var croppicHeaderOptions = {
//uploadUrl:'img_save_to_file.php',
cropData: {
"dummyData": 1,
"dummyData2": "asdas"
},
cropUrl: 'img_crop_to_file.php',
customUploadButtonId: 'cropContainerHeaderButton',
modal: false,
processInline: true,
loaderHtml: ' ',
onBeforeImgUpload: function() {
console.log('onBeforeImgUpload')
},
onAfterImgUpload: function() {
console.log('onAfterImgUpload')
},
onImgDrag: function() {
console.log('onImgDrag')
},
onImgZoom: function() {
console.log('onImgZoom')
},
onBeforeImgCrop: function() {
console.log('onBeforeImgCrop')
},
onAfterImgCrop: function() {
console.log('onAfterImgCrop')
},
onReset: function() {
console.log('onReset')
},
onError: function(errormessage) {
console.log('onError:' + errormessage)
}
}
var croppic = new Croppic('croppic', croppicHeaderOptions);
PHP CroppingDemo address: http://www.sucaihuo.com/js/480.html
Php?croppiccut image plug-in. Zip (1.67 MB download: 48 times)
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB