keepMeta is not working on iOS
See original GitHub issueI want to keep metadata when resizing an image.
I used ImageResizer.createResizedImage with keepMeta = true.
However, it is not working on iOS.
As a result of the analysis, getImageMeta() function is not working. It returns before getting the metadata from an image URI.
NSMutableDictionary * getImageMeta(NSString * path)
{
if([path hasPrefix:@"assets-library"]) {
__block NSMutableDictionary* res = nil;
ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
{
// (1) here asynchronous processing
NSDictionary *exif = [[myasset defaultRepresentation] metadata];
res = [exif mutableCopy];
};
ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
NSURL *url = [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[assetslibrary assetForURL:url resultBlock:resultblock failureBlock:^(NSError *error) { NSLog(@"error couldn't image from assets library"); }];
// (2) result is returned before (1) is finished.
return res;
}
this issue can be prevented by using semaphore system.
environment
iPhoneSE 2generation (IOS 14.81) / iPhone12ProMax (iOS 15.1) react-native: 0.63.4 react-native-image-resizer: 1.4.5
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
ios - Safari meta refresh not working with my iphone app
It seems like the meta refresh timer is running in the background and if Safari isn't in the foreground - it won't do...
Read more >Fix Facebook Keeps Crashing on iPhone, iPad after iOS 16 ...
in this blog post, I'll help you to fix Facebook won't open on ipad/iPhone after the latest iOS update Or App Server &...
Read more >Solved: Oculus App on iPhone crashing/not launching
Hi everyone, the team is working on this issue with the app that's causing a crash or failing to load after the update....
Read more >Troubleshoot apps and features - Meta
To report a bug from the Meta Quest mobile app: Shake your phone until the Report a Problem screen appears. Tap Something Isn't...
Read more >Supported Meta Tags - Apple Developer
Describes the Hypertext Markup Language (HTML) tags and properties that are supported by Safari and WebKit.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@odexvy Yes, I have prevented this issue applying the following code.
node_modules/react-native-image-resizer/ios/RCTImageResizer.mthank you very much @ishikawa-takumi 👍