Skip to content

Commit 8f2f33e

Browse files
committed
add image size
1 parent 7cd7680 commit 8f2f33e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ios/RCTARKitManager.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ - (void)storeImageInPhotoAlbum:(UIImage *)image reject:(RCTPromiseRejectBlock)re
116116
} completionHandler:^(BOOL success, NSError *error) {
117117
if (success)
118118
{
119-
119+
120120
NSString * localID = placeholder.localIdentifier;
121121

122122
NSString * assetURLStr = [self getAssetUrl:localID];
123-
124-
resolve(@{@"url": assetURLStr});
123+
124+
resolve(@{@"url": assetURLStr, @"width":@(image.size.width), @"height": @(image.size.height)});
125125
}
126126
else
127127
{
@@ -149,7 +149,7 @@ - (void)storeImageInDirectory:(UIImage *)image directory:(NSString *)directory f
149149
NSString *filePath = [directory stringByAppendingPathComponent:uniqueFileName]; //Add the file name
150150
bool success = [data writeToFile:filePath atomically:YES]; //Write the file
151151
if(success) {
152-
resolve(@{@"url": filePath});
152+
resolve(@{@"url": filePath, @"width":@(image.size.width), @"height": @(image.size.height)});
153153
} else {
154154
// TODO use NSError from writeToFile
155155
reject(@"snapshot_error", [NSString stringWithFormat:@"could not save to '%@'", filePath], nil);
@@ -176,7 +176,7 @@ - (void)storeImage:(UIImage *)image options:(NSDictionary *)options reject:(RCTP
176176
dir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
177177
} else if([target isEqualToString:@"documents"]) {
178178
dir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
179-
179+
180180
} else {
181181
dir = target;
182182
}
@@ -232,3 +232,4 @@ - (void)storeImage:(UIImage *)image options:(NSDictionary *)options reject:(RCTP
232232
}
233233

234234
@end
235+

0 commit comments

Comments
 (0)