Skip to content

Commit

Permalink
Read image as data from path
Browse files Browse the repository at this point in the history
In order to use this with react-native-image-picker I needed to create the UIImage instance from a file:https://... path.
  • Loading branch information
tonimoeckel committed Sep 26, 2018
1 parent 2ca71d9 commit 31f44d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ios/RNPhotoEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ - (void)canceledEditing {
PhotoEditorViewController *photoEditor = [[PhotoEditorViewController alloc] initWithNibName:@"PhotoEditorViewController" bundle: [NSBundle bundleForClass:[PhotoEditorViewController class]]];

// Process Image for Editing
UIImage *image = [UIImage imageWithContentsOfFile:_editImagePath];
NSURL *url = [NSURL URLWithString:_editImagePath];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:data];
photoEditor.image = image;

// Process Stickers
Expand Down

0 comments on commit 31f44d3

Please sign in to comment.