Crop插件不能修改大小

https://github.com/qwerqwermhc/Crop

如上所示是我修改后的源码地址 可以设置crop的宽高

return this.crop.crop(imageURI, {
quality: 100,
// targetHeight: 100,
// targetWidth: 200,

widthRatio: 100,
heightRatio: 200,
}).then(newPath => {
return this.toBase64(newPath).then((base64Img) => {
return base64Img;
});
},
error => {
console.log( "CROP ERROR -> " + JSON.stringify(error));

}
);

quality是像素清晰度

widthRatio宽度

heightRatio高度

只需要从官网引入插件 然后把我的下载下来放到相应目录就行了 

猜你喜欢

转载自blog.csdn.net/u012938852/article/details/80577692