Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createResizedImage is not a function #68

Open
raduiamandi-pilot opened this issue Jul 5, 2024 · 0 comments
Open

createResizedImage is not a function #68

raduiamandi-pilot opened this issue Jul 5, 2024 · 0 comments

Comments

@raduiamandi-pilot
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-amazing-cropper@0.2.6 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-amazing-cropper/src/Cropper/Cropper.page.tsx b/node_modules/react-native-amazing-cropper/src/Cropper/Cropper.page.tsx
index 73e973e..e6f7286 100644
--- a/node_modules/react-native-amazing-cropper/src/Cropper/Cropper.page.tsx
+++ b/node_modules/react-native-amazing-cropper/src/Cropper/Cropper.page.tsx
@@ -1,6 +1,6 @@
 import React, { Component } from 'react';
 import { Animated, PanResponder, Platform, PanResponderInstance, PanResponderGestureState, ImageCropData } from 'react-native';
-import { createResizedImage } from '@bam.tech/react-native-image-resizer';
+import ImageResizer from '@bam.tech/react-native-image-resizer';
 // @ts-ignore - react-native-image-rotate does not have typescript support
 import ImageRotate from '@wili/react-native-image-rotate';
 import ImageEditor from '@react-native-community/image-editor';
@@ -697,7 +697,7 @@ class CropperPage extends Component<CropperPageProps, State> {
       resizeMode: 'stretch',
     } as ImageCropData;
     // we need to use this function because otherwise the crop may not work properly (see https://github.com/callstack/react-native-image-editor/issues/54)
-    createResizedImage(this.props.imageUri, imageWidth, imageHeight, 'JPEG', 100, Platform.OS === 'ios' ? 0 : this.state.rotation, undefined, false, {
+    ImageResizer.createResizedImage(this.props.imageUri, imageWidth, imageHeight, 'JPEG', 100, Platform.OS === 'ios' ? 0 : this.state.rotation, undefined, false, {
       mode: 'cover',
       onlyScaleDown: true,
     })

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant