react-native-image-editor icon indicating copy to clipboard operation
react-native-image-editor copied to clipboard

Add support a 'contain' resize mode for Android

Open retyui opened this issue 4 years ago • 2 comments

This PR adds breaking changes!

Test Plan

demo gif

  1. Install:
npx react-native init testEditor
cd testEditor
yarn add retyui/react-native-image-editor#android-contain-resize-mode
  1. Paste code from example/App.js

  2. 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)

retyui avatar Oct 07 '20 09:10 retyui

another polite reminder @EvanBacon , @Naturalclar

retyui avatar Sep 13 '21 16:09 retyui

I apologize but I'm not familiar with this package.

EvanBacon avatar Nov 22 '21 21:11 EvanBacon