Skip to content

Commit 509a08d

Browse files
authored
✏️ Rename method (#326)
1 parent 76b2af2 commit 509a08d

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

android/src/legacy/ImageResizerModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public String getName() {
2626
}
2727

2828
@ReactMethod
29-
public void createdResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise) {
30-
ImageResizerModuleImpl.createdResizedImage(uri, width, height, format, quality, rotation, outputPath, keepMeta, mode, onlyScaleDown, promise, this.context, getReactApplicationContext());
29+
public void createResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise) {
30+
ImageResizerModuleImpl.createResizedImage(uri, width, height, format, quality, rotation, outputPath, keepMeta, mode, onlyScaleDown, promise, this.context, getReactApplicationContext());
3131
}
3232
}

android/src/main/java/com/reactnativeimageresizer/ImageResizerModuleImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class ImageResizerModuleImpl {
2424
public static final String NAME = "ImageResizer";
2525

26-
public static void createdResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise, Context context, ReactApplicationContext reactContext) {
26+
public static void createResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise, Context context, ReactApplicationContext reactContext) {
2727
WritableMap options = Arguments.createMap();
2828
options.putString("mode", mode);
2929
options.putBoolean("onlyScaleDown", onlyScaleDown);

android/src/turbo/ImageResizerModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public String getName() {
2424
}
2525

2626
@Override
27-
public void createdResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise) {
28-
ImageResizerModuleImpl.createdResizedImage(uri, width, height, format, quality, rotation, outputPath, keepMeta, mode, onlyScaleDown, promise, this.context, getReactApplicationContext());
27+
public void createResizedImage(String uri, double width, double height, String format, double quality, Double rotation, @Nullable String outputPath, Boolean keepMeta, @Nullable String mode, Boolean onlyScaleDown, Promise promise) {
28+
ImageResizerModuleImpl.createResizedImage(uri, width, height, format, quality, rotation, outputPath, keepMeta, mode, onlyScaleDown, promise, this.context, getReactApplicationContext());
2929
}
3030
}

example/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
TouchableOpacity,
2020
View,
2121
} from 'react-native';
22-
import { createdResizedImage } from '@bam.tech/react-native-image-resizer';
22+
import { createResizedImage } from '@bam.tech/react-native-image-resizer';
2323
import type {
2424
ResizeMode,
2525
Response,
@@ -65,7 +65,7 @@ const App = () => {
6565
setResizedImage(null);
6666

6767
try {
68-
let result = await createdResizedImage(
68+
let result = await createResizedImage(
6969
image.uri,
7070
sizeTarget,
7171
sizeTarget,

ios/ImageResizer.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
@implementation ImageResizer
1717
RCT_EXPORT_MODULE()
1818

19-
RCT_REMAP_METHOD(createdResizedImage, uri:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(nonnull NSNumber *)keepMeta mode:(NSString *)mode onlyScaleDown:(nonnull NSNumber *)onlyScaleDown resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
19+
RCT_REMAP_METHOD(createResizedImage, uri:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(nonnull NSNumber *)keepMeta mode:(NSString *)mode onlyScaleDown:(nonnull NSNumber *)onlyScaleDown resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
2020
{
21-
[self createdResizedImage:uri width:width height:height format:format quality:quality rotation:rotation outputPath:outputPath keepMeta:keepMeta mode:mode onlyScaleDown:onlyScaleDown resolve:resolve reject:reject];
21+
[self createResizedImage:uri width:width height:height format:format quality:quality rotation:rotation outputPath:outputPath keepMeta:keepMeta mode:mode onlyScaleDown:onlyScaleDown resolve:resolve reject:reject];
2222
}
2323

24-
- (void)createdResizedImage:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(nonnull NSNumber *)keepMeta mode:(NSString *)mode onlyScaleDown:(nonnull NSNumber *)onlyScaleDown resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
24+
- (void)createResizedImage:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(nonnull NSNumber *)keepMeta mode:(NSString *)mode onlyScaleDown:(nonnull NSNumber *)onlyScaleDown resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
2525
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
2626
@try {
2727
CGSize newSize = CGSizeMake(width, height);

src/NativeImageResizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { TurboModule } from 'react-native';
22
import { TurboModuleRegistry } from 'react-native';
33

44
export interface Spec extends TurboModule {
5-
createdResizedImage(
5+
createResizedImage(
66
uri: string,
77
width: number,
88
height: number,

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ImageResizer = isTurboModuleEnabled
99
? require('./NativeImageResizer').default
1010
: NativeModules.ImageResizer;
1111

12-
export function createdResizedImage(
12+
export function createResizedImage(
1313
uri: string,
1414
width: number,
1515
height: number,
@@ -42,7 +42,7 @@ export function createdResizedImage(
4242
const mode = options?.mode;
4343
const onlyScaleDown = options?.onlyScaleDown;
4444

45-
return ImageResizer.createdResizedImage(
45+
return ImageResizer.createResizedImage(
4646
uri,
4747
width,
4848
height,

0 commit comments

Comments
 (0)