Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ios/GMImagePicker/GMGridViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,13 @@ - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtInde
fetch_item.be_progressed = false;
fetch_item.be_finished = true;

NSString *fileName =[asset valueForKey:@"filename"];
NSString *fileExtension = [fileName pathExtension];
if ([dataUTI containsString:@"heic"]) {
CIImage *ciImage = [CIImage imageWithData:imageData];
NSData* data = [[[CIContext alloc] init] JPEGRepresentationOfImage:ciImage colorSpace:CGColorSpaceCreateDeviceRGB() options:@{}];
imageData = data;
fileExtension = @"jpg";
}


Expand All @@ -507,7 +510,7 @@ - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtInde
NSString * filePath;
do {

filePath = [NSString stringWithFormat:@"%@/%@.%@", libPath, [[NSUUID UUID] UUIDString], @"jpg"];
filePath = [NSString stringWithFormat:@"%@/%@.%@", libPath, [[NSUUID UUID] UUIDString], [fileExtension lowercaseString]];
} while ([fileMgr fileExistsAtPath:filePath]);

fetch_item.be_saving_img = true;
Expand Down