Skip to content

Commit

Permalink
Allow iOS usage with other image provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvilleneuve committed May 27, 2019
1 parent 329421c commit de5e870
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/CustomCropManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ @implementation CustomCropManager

RCT_EXPORT_METHOD(crop:(NSDictionary *)points imageUri:(NSString *)imageUri callback:(RCTResponseSenderBlock)callback)
{
NSURL *fileURL = [NSURL fileURLWithPath:imageUri];
NSString *parsedImageUri = [imageUri stringByReplacingOccurrencesOfString:@"file://" withString:@""];
NSURL *fileURL = [NSURL fileURLWithPath:parsedImageUri];
CIImage *ciImage = [CIImage imageWithContentsOfURL:fileURL];

CGPoint newLeft = CGPointMake([points[@"topLeft"][@"x"] floatValue], [points[@"topLeft"][@"y"] floatValue]);
Expand Down

0 comments on commit de5e870

Please sign in to comment.