Skip to content

Commit

Permalink
Merge pull request #150 from CareEvolution/eschramm/reload-image-capture
Browse files Browse the repository at this point in the history
Setup entire state needed to load previous imageCaptureResult
  • Loading branch information
eschramm authored Oct 29, 2024
2 parents 5f95177 + f68f2f7 commit 8d19c86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ORK1Kit/ORK1Kit/Common/ORK1ImageCaptureStepViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ - (instancetype)initWithStep:(ORK1Step *)step result:(ORK1Result *)result {

if (fileResult.fileURL) {
// Setting these properties in this order allows us to reuse the existing file on disk
self.capturedImageData = [NSData dataWithContentsOfURL:fileResult.fileURL];
NSData *imageData = [NSData dataWithContentsOfURL:fileResult.fileURL];
_imageDataExtension = fileResult.fileURL.pathExtension;
_previewImage = [UIImage imageWithData:imageData];
self.capturedImageData = imageData;
_fileURL = fileResult.fileURL;
}
}
Expand Down
5 changes: 4 additions & 1 deletion ResearchKit/Common/ORKImageCaptureStepViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ - (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result {

if (fileResult.fileURL) {
// Setting these properties in this order allows us to reuse the existing file on disk
self.capturedImageData = [NSData dataWithContentsOfURL:fileResult.fileURL];
NSData *imageData = [NSData dataWithContentsOfURL:fileResult.fileURL];
_imageDataExtension = fileResult.fileURL.pathExtension;
_previewImage = [UIImage imageWithData:imageData];
self.capturedImageData = imageData;
_fileURL = fileResult.fileURL;
}
}
Expand Down

0 comments on commit 8d19c86

Please sign in to comment.