Output size of ImageEditor.cropImage become smaller
mingxin-yang opened this issue · 3 comments
mingxin-yang commented
Bug
Output size of ImageEditor.cropImage become smaller
Environment info
React native info output:
// paste it here
Library version: 2.1.0
Steps To Reproduce
my code:
const cropData = {
offset: { x, y },
size: { width, height },
displaySize:{width,height},
resizeMode: "cover"
};
RNFS.stat(this.props.imageUri).then((value)=>{
console.warn("this.props.imageUri",value) // size is 2302015
})
console.warn("imageUri",this.props.imageUri,this.state.rotation);
RNImageRotate.rotateImage(
this.props.imageUri,
this.state.rotation,
rotatedUri => {
ImageEditor.cropImage(
this.props.imageUri,
cropData,
croppedUri => {
RNFS.stat(croppedUri).then((value)=>{
console.warn("croppedUri",value) // size is 818649
})
this.props.onDone(croppedUri);
},
err => {
console.log("cropping error");
console.log(err);
}
);
},
err => {
alert(err);
console.log(err);
}
);
Describe what you expected to happen:
when the width and height is origin of the image, output size is 2302015
Reproducible sample code
linhmimoza commented
try displaySize: {width * 4 ,height * 4}
It worked for me
s123121 commented
I have tried various combination, one thing stood out to me is the cropped image quality is always degraded compared to the input ( which you can see clearly with your eyes)