question: @ ReactMethod public void cropImage ( String uri , ReadableMap options , final Callback success , final Callback error ) { ReadableMap offset = options . hasKey ( "offset" ) ? options . getMap ( "offset" ) : null ; ReadableMap size = options . hasKey ( "size" ) ? options . getMap ( "size" ) : null ; if ( offset == null || size == null || ! offset . hasKey ( "x" ) || ! offset . hasKey ( "y" ) || ! size . hasKey ( "width" ) || ! size . hasKey ( "height" ) ) { throw new JSApplicationIllegalArgumentException ( "Please specify offset and size" ) ; } if ( uri == null || uri . isEmpty ( ) ) { throw new JSApplicationIllegalArgumentException ( "Please specify a URI" ) ; } CropTask cropTask = new CropTask ( getReactApplicationContext ( ) , uri , ( int ) offset . getDouble ( "x" ) , ( int ) offset . getDouble ( "y" ) , ( int ) size . getDouble ( "width" ) , ( int ) size . getDouble ( "height" ) , success , error ) ; if ( options . hasKey ( "displaySize" ) ) { ReadableMap targetSize = options . getMap ( "displaySize" ) ; cropTask . setTargetSize ( targetSize . getInt ( "width" ) , targetSize . getInt ( "height" ) ) ; } cropTask . executeOnExecutor ( AsyncTask . THREAD_POOL_EXECUTOR ) ; }
target:  Crop an image. If all goes well, the success callback will be called with the file:// URI of the new image as the only argument. This is a temporary file - consider using CameraRollManager.saveImageWithTag to save it in the gallery.