bugfix for load gif file form different bundle
This commit is contained in:
parent
93657580aa
commit
b60a3532c4
@ -124,7 +124,7 @@ typedef void(^MVMCoreGetImageBlock)(UIImage * _Nullable, NSData * _Nullable, BOO
|
|||||||
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
||||||
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
||||||
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams localBundle:(nullable NSBundle *)localBundle completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
- (void)getImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams localBundle:(nullable NSBundle *)localBundle completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
||||||
- (void)getGif:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
- (void)getGif:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams localBundle:(nullable NSBundle *)localBundle completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
||||||
|
|
||||||
// Gets a cropped version of the requested image. Similar to the method above, but you can specify the final rect
|
// Gets a cropped version of the requested image. Similar to the method above, but you can specify the final rect
|
||||||
- (void)getCroppedImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 finalRect:(CGRect)finalRect flipImage:(BOOL)flipImage localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
- (void)getCroppedImage:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 finalRect:(CGRect)finalRect flipImage:(BOOL)flipImage localFallbackImageName:(nullable NSString *)fallbackImageName completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler;
|
||||||
|
|||||||
@ -471,7 +471,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
|||||||
[self getImage:pathOrName useWidth:useWidth widthForS7:widthForS7 useHeight:useHeight heightForS7:heightForS7 format:format finalRect:CGRectNull flipImage:NO localFallbackImageName:fallbackImageName allowServerQueryParameters:allowServerParams localBundle:localBundle completionHandler:completionHandler];
|
[self getImage:pathOrName useWidth:useWidth widthForS7:widthForS7 useHeight:useHeight heightForS7:heightForS7 format:format finalRect:CGRectNull flipImage:NO localFallbackImageName:fallbackImageName allowServerQueryParameters:allowServerParams localBundle:localBundle completionHandler:completionHandler];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)getGif:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler {
|
- (void)getGif:(nullable NSString *)pathOrName useWidth:(BOOL)useWidth widthForS7:(NSInteger)widthForS7 useHeight:(BOOL)useHeight heightForS7:(NSInteger)heightForS7 format:(nullable NSString *)format localFallbackImageName:(nullable NSString *)fallbackImageName allowServerQueryParameters:(BOOL)allowServerParams localBundle:(nullable NSBundle *)localBundle completionHandler:(nonnull MVMCoreGetImageBlock)completionHandler {
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
NSData *imageData = nil;
|
NSData *imageData = nil;
|
||||||
@ -487,7 +487,8 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
|||||||
// Try Local. Check in memory cache
|
// Try Local. Check in memory cache
|
||||||
imageData = [self getCachedDataWithName:pathOrName];
|
imageData = [self getCachedDataWithName:pathOrName];
|
||||||
if (!imageData) {
|
if (!imageData) {
|
||||||
imageData = [NSData dataWithContentsOfFile:[[self bundleToUseForImages] pathForResource:pathOrName ofType:@"gif"]];
|
NSBundle *imageBundle = localBundle ? : [self bundleToUseForImages];
|
||||||
|
imageData = [NSData dataWithContentsOfFile:[imageBundle pathForResource:pathOrName ofType:@"gif"]];
|
||||||
if (imageData) {
|
if (imageData) {
|
||||||
[self addDataToCache:imageData withName:pathOrName];
|
[self addDataToCache:imageData withName:pathOrName];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user