bamlab / react-native-image-resizer

🗻 Resize local images with React Native
MIT License
1.6k stars 342 forks source link

fix: No matching function for call to 'transformImage' (#342) #350

Closed chj-damon closed 1 year ago

chj-damon commented 1 year ago

fix error when archive app in xcode

robingullo commented 1 year ago

Thank you for your contribution. We don't want to modify the signature of the methods, since they need to be compatible with the architecture's codegen. Could you try instead in line 53 of ImageResizer.mm:

-            NSDictionary * response =  transformImage(image, uri, [rotation integerValue], newSize, fullPath, format, (int)quality, keepMeta, @{@"mode": mode, @"onlyScaleDown": [NSNumber numberWithBool:onlyScaleDown]});
+            NSDictionary * response =  transformImage(image, uri, [rotation integerValue], newSize, fullPath, format, (int)quality, [keepMeta boolValue], @{@"mode": mode, @"onlyScaleDown": [NSNumber numberWithBool:onlyScaleDown]});
chj-damon commented 1 year ago

@robingullo I tried this solution in xcode 13.4.1 and it works.

also, I tried not change any code and it also works in xcode 14.2/m2 chip. I don't why

chj-damon commented 1 year ago

updated.

taboulot commented 1 year ago

I have Xcode 14.0.1 and no error occurred without the fix but I have a warning.

I think some configurations changed in the Xcode compiler during migration from 13.x -> 14.x with the consequence that this error in version 13 was only a warning in version 14.

Anyway, this PR fix a syntax error, improve the code & fix #342.