Merge branch 'mkirk/ios11-images'

pull/1/head
Michael Kirk 8 years ago
commit 77760b8adb

@ -3311,6 +3311,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
} else {
// Non-Video image picked from library
// To avoid re-encoding GIF and PNG's as JPEG we have to get the raw data of
// the selected item vs. using the UIImagePickerControllerOriginalImage
NSURL *assetURL = info[UIImagePickerControllerReferenceURL];
PHAsset *asset = [[PHAsset fetchAssetsWithALAssetURLs:@[ assetURL ] options:nil] lastObject];
if (!asset) {

@ -251,7 +251,12 @@ class SignalAttachment: NSObject {
// Image attachments may be converted to another image format before
// being uploaded.
private class var inputImageUTISet: Set<String> {
return MIMETypeUtil.supportedImageUTITypes().union(animatedImageUTISet)
// HEIC is valid input, but not valid output. Non-iOS11 clients do not support it.
let heicSet: Set<String> = Set(["public.heic", "public.heif"])
return MIMETypeUtil.supportedImageUTITypes()
.union(animatedImageUTISet)
.union(heicSet)
}
// Returns the set of UTIs that correspond to valid _output_ image formats
@ -441,7 +446,7 @@ class SignalAttachment: NSObject {
}
guard imageData.count > 0 else {
assert(imageData.count > 0)
owsFail("\(self.TAG) in \(#function) imageData was empty")
attachment.error = .invalidData
return attachment
}

Loading…
Cancel
Save