Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
In iOS/Watch we don't need to read the ICC profile from the encoded i…
…mage since iOS does not support device agnostic color spaces. Remove reference to empty project file
  • Loading branch information
punty committed May 21, 2019
commit b11f8af88275eb29c27c0f35f6b2562eff7a7a7e
3 changes: 0 additions & 3 deletions SDWebImageWebPCoder.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
9 changes: 8 additions & 1 deletion SDWebImageWebPCoder/Classes/SDImageWebPCoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,16 @@ - (NSTimeInterval)sd_frameDurationWithIterator:(WebPIterator)iter {

// Create and return the correct colorspace by checking the ICC Profile
- (nonnull CGColorSpaceRef)sd_colorSpaceWithDemuxer:(nonnull WebPDemuxer *)demuxer CF_RETURNS_RETAINED {
CGColorSpaceRef colorSpaceRef = NULL;
#if SD_UIKIT || SD_WATCH
colorSpaceRef = [SDImageCoderHelper colorSpaceGetDeviceRGB];
CGColorSpaceRetain(colorSpaceRef);
return colorSpaceRef;
#else
// WebP contains ICC Profile should use the desired colorspace, instead of default device colorspace
// See: https://developers.google.com/speed/webp/docs/riff_container#color_profile

CGColorSpaceRef colorSpaceRef = NULL;

uint32_t flags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS);

if (flags & ICCP_FLAG) {
Expand Down Expand Up @@ -451,6 +457,7 @@ - (nonnull CGColorSpaceRef)sd_colorSpaceWithDemuxer:(nonnull WebPDemuxer *)demux
}

return colorSpaceRef;
#endif
}

#pragma mark - Encode
Expand Down