Skip to content
Closed
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#import "FLTImagePickerImageUtil.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>


@interface GIFInfo ()

Expand Down Expand Up @@ -117,7 +119,13 @@ + (GIFInfo *)scaledGIFImage:(NSData *)data
maxHeight:(NSNumber *)maxHeight {
NSMutableDictionary<NSString *, id> *options = [NSMutableDictionary dictionary];
options[(NSString *)kCGImageSourceShouldCache] = @YES;
if (@available(iOS 14.0, *)) {
options[(NSString *)kCGImageSourceTypeIdentifierHint] = UTTypeGIF.identifier;
} else {
options[(NSString *)kCGImageSourceTypeIdentifierHint] = (NSString *)kUTTypeGIF;
}



CGImageSourceRef imageSource =
CGImageSourceCreateWithData((__bridge CFDataRef)data, (__bridge CFDictionaryRef)options);
Expand Down