GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: update up 4.4.7. · iOSCopder/SDWebImage@8185423

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • SDWebImage.podspec
  • SDWebImage
    • SDImageCache.h
    • SDImageCache.m
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎SDWebImage.podspec‎

Copy file name to clipboardExpand all lines: SDWebImage.podspec
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'SDWebImage'
3-
s.version = '4.4.6'
3+
s.version = '4.4.7'
44

55
s.osx.deployment_target = '10.9'
66
s.ios.deployment_target = '7.0'
Collapse file

‎SDWebImage/SDImageCache.h‎

Copy file name to clipboardExpand all lines: SDWebImage/SDImageCache.h
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,25 @@ typedef void(^SDWebImageCalculateSizeBlock)(NSUInteger fileCount, NSUInteger tot
134134
toDisk:(BOOL)toDisk
135135
completion:(nullable SDWebImageNoParamsBlock)completionBlock;
136136

137+
/**
138+
* Asynchronously store an image into memory and disk cache at the given key.
139+
*
140+
* @param image The image to store
141+
* @param imageData The image data as returned by the server, this representation will be used for disk storage
142+
* instead of converting the given image object into a storable/compressed image format in order
143+
* to save quality and CPU
144+
* @param key The unique image cache key, usually it's image absolute URL
145+
* @param toDisk Store the image to disk cache if YES
146+
* @param isJPEG Store the image to JPEG if YES
147+
* @param completionBlock A block executed after the operation is finished
148+
*/
149+
- (void)storeImage:(nullable UIImage *)image
150+
imageData:(nullable NSData *)imageData
151+
forKey:(nullable NSString *)key
152+
toDisk:(BOOL)toDisk
153+
isJPEG:(BOOL)isJPEG
154+
completion:(nullable SDWebImageNoParamsBlock)completionBlock;
155+
137156
/**
138157
* Asynchronously store an image into memory and disk cache at the given key.
139158
*
Collapse file

‎SDWebImage/SDImageCache.m‎

Copy file name to clipboardExpand all lines: SDWebImage/SDImageCache.m
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,15 @@ - (void)storeImage:(nullable UIImage *)image
285285
forKey:(nullable NSString *)key
286286
toDisk:(BOOL)toDisk
287287
completion:(nullable SDWebImageNoParamsBlock)completionBlock {
288+
[self storeImage:image imageData:imageData forKey:key toDisk:toDisk isJPEG:NO completion:completionBlock];
289+
}
290+
291+
- (void)storeImage:(nullable UIImage *)image
292+
imageData:(nullable NSData *)imageData
293+
forKey:(nullable NSString *)key
294+
toDisk:(BOOL)toDisk
295+
isJPEG:(BOOL)isJPEG
296+
completion:(nullable SDWebImageNoParamsBlock)completionBlock {
288297
if (!image || !key) {
289298
if (completionBlock) {
290299
completionBlock();
@@ -304,7 +313,7 @@ - (void)storeImage:(nullable UIImage *)image
304313
if (!data && image) {
305314
// If we do not have any data to detect image format, check whether it contains alpha channel to use PNG or JPEG format
306315
SDImageFormat format;
307-
if (SDCGImageRefContainsAlpha(image.CGImage)) {
316+
if (!isJPEG && SDCGImageRefContainsAlpha(image.CGImage)) {
308317
format = SDImageFormatPNG;
309318
} else {
310319
format = SDImageFormatJPEG;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.