Update the convenient API for UIImage (not SDAnimatedImage) to grab the current image format when no encode format provided

This match two classes behavior
This commit is contained in:
DreamPiggy 2023-10-08 15:34:25 +08:00
parent 4acf569171
commit 9078f316f7
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#import "UIImage+MultiFormat.h" #import "UIImage+MultiFormat.h"
#import "SDImageCodersManager.h" #import "SDImageCodersManager.h"
#import "SDAnimatedImageRep.h" #import "SDAnimatedImageRep.h"
#import "UIImage+Metadata.h"
@implementation UIImage (MultiFormat) @implementation UIImage (MultiFormat)
@ -41,7 +42,7 @@
} }
} }
#endif #endif
return [self sd_imageDataAsFormat:SDImageFormatUndefined]; return [self sd_imageDataAsFormat:self.sd_imageFormat];
} }
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat {