Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
yh_sdwebimage
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
DreamPiggy
7 years ago
Commit
d62e965833f2600432c55828a3b8145cddcfa271
1 parent
cd37ef67
For ImageIO coder, if the image is scaled down, then we need to modify the origi…
…nal image data pointer
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
SDWebImage/SDWebImageImageIOCoder.m
SDWebImage/SDWebImageImageIOCoder.m
View file @
d62e965
...
...
@@ -213,7 +213,16 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over
if
(
!
shouldScaleDown
)
{
return
[
self
sd_decompressedImageWithImage
:
image
];
}
else
{
return
[
self
sd_decompressedAndScaledDownImageWithImage
:
image
];
UIImage
*
scaledDownImage
=
[
self
sd_decompressedAndScaledDownImageWithImage
:
image
];
if
(
scaledDownImage
&&
!
CGSizeEqualToSize
(
scaledDownImage
.
size
,
image
.
size
))
{
// if the image is scaled down, need to modify the data pointer as well
SDImageFormat
format
=
[
NSData
sd_imageFormatForImageData
:
*
data
];
NSData
*
imageData
=
[
self
encodedDataWithImage
:
scaledDownImage
format
:
format
];
if
(
imageData
)
{
*
data
=
imageData
;
}
}
return
scaledDownImage
;
}
#endif
}
...
...
Please
register
or
login
to post a comment