Closed ohayou12 closed 1 year ago
Hi @ohayou12 ,
Can you provide me an example.
This is what I tried on my side in the example project with last version :
let result = await ImageResizer.createResizedImage(
image.uri,
sizeTarget,
sizeTarget,
'JPEG',
100,
undefined,
undefined,
true // keepMeta true, same result with false
);
And I had no error ...
@ohayou12
Ok, I think the problem is that I did not keep the default value of keepMeta
during the migration.
I fixed it in #343. It is deployed now on 3.0.4. Can you use it and keep me up-to-date?
Hi @taboulot , I 've updated and getting the same error. Additionally, I copied the example you gave but the error remains.
any idea?
Hmmmm.
Can you provide me a repo with a reproducible example ?
i have resolve the probleme by changing in ImageResizer.m the type of keepMeta from (NSString *) to (BOOL)
in two line 19 and 24
for exemple in line 24 i changed `
By
- (void)createResizedImage:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality mode:(NSString *)mode onlyScaleDown:(BOOL)onlyScaleDown rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(BOOL)keepMeta resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
@skorchi
Since the 3.x.x version the type is not (NSString *)
but (NSNumber *)
🧐
@davidarnaub7
And Are you able to reproduce it in the example project of the repo?
@taboulot
i have the same problem, i fixed by changing the type of keepMeta by BOOL in line 19 and 24
@taboulot
in xcode, I run Product -> Archive
, then I receive this error. It is normal if yarn ios
is run.
keepMeta
is a Bool at line 337, but NSNumber at line 53, which I think is probably due to the xcode version. Then I change keepMeta
to true
or false
at line 53 and run Product -> Archive
again and it works fine.
https://github.com/bamlab/react-native-image-resizer/blob/7548326e7554b9cc5a9ae5c46512003506d30427/ios/ImageResizer.mm#L337
https://github.com/bamlab/react-native-image-resizer/blob/7548326e7554b9cc5a9ae5c46512003506d30427/ios/ImageResizer.mm#L53
same here.
@ohayou12 can you create a PR to fix this?
@chj-damon Thank you for your contribution. Would you mind continuing the discussion in the PR ?
@robingullo updated.
run archive receive an error
error details:
environment
variable
keepMeta
need a Bool in 53 line, but receive a NSNumberhttps://github.com/bamlab/react-native-image-resizer/blob/2ab4fb4bda208b960740a5d9011ab1bc4d3de521/ios/ImageResizer.mm#L330-L338
https://github.com/bamlab/react-native-image-resizer/blob/2ab4fb4bda208b960740a5d9011ab1bc4d3de521/ios/ImageResizer.mm#L24-L60