react-native-image-editor
react-native-image-editor copied to clipboard
Add support a 'contain' resize mode for Android
This PR adds breaking changes!
Test Plan
- Install:
npx react-native init testEditor
cd testEditor
yarn add retyui/react-native-image-editor#android-contain-resize-mode
-
Paste code from example/App.js
-
Extends crop data
const cropData: ImageCropData = {
offset: {
x: this.props.image.width * offsetRatioX,
y: this.props.image.height * offsetRatioY,
},
size: {
width: this.props.image.width * sizeRatioX,
height: this.props.image.height * sizeRatioY,
},
+ resizeMode: 'contain',
+ displaySize: {
+ width: 2000,
+ height: 1000,
+ },
};
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
OS | Implemented |
---|---|
iOS | ✅ |
Android | ✅ |
Checklist
- [x] I have tested this on a device and a simulator
- [x] I added the documentation in
README.md
- [ ] I mentioned this change in
CHANGELOG.md
- [x] I updated the typed files (TS and Flow)
- [ ] I added a sample use of the API in the example project (
example/App.js
)
another polite reminder @EvanBacon , @Naturalclar
I apologize but I'm not familiar with this package.