Skip to content

Conversation

dreampiggy
Copy link
Contributor

@dreampiggy dreampiggy commented Sep 12, 2019

Continue Fix to #22 .

This time it works...The logic need to be replaced from this:

 // Draw from range: [startIndex, endIndex) if (endIndex > startIndex) { do { @autoreleasepool { [self sd_blendWebpImageWithCanvas:_canvas iterator:iter colorSpace:_colorSpace]; } } while ((size_t)iter.frame_num < (endIndex + 1) && WebPDemuxNextFrame(&iter)); }

To:

 // Draw from range: [startIndex, endIndex) if (endIndex > startIndex) { do { @autoreleasepool { [self sd_blendWebpImageWithCanvas:_canvas iterator:iter colorSpace:_colorSpace]; } } while ((size_t)iter.frame_num < endIndex && WebPDemuxNextFrame(&iter)); } // libwebp's index start with 1 if (!WebPDemuxGetFrame(_demux, (int)(index + 1), &iter)) { WebPDemuxReleaseIterator(&iter); return nil; }

See screenshot video:

Screenshot.mp4.zip

@dreampiggy dreampiggy force-pushed the fix_animated_webp_frame_blend_issue branch from fd2c2bc to 3e3b7e3 Compare September 12, 2019 09:40
@dreampiggy dreampiggy changed the title Recheck the animated canvas calculation logic, fix the issue of that calculation, refactory the sd_drawnWebpImageWithCanvas and sd_blendWebpImageWithCanvas logic into on method Recheck the animated canvas calculation logic, fix the issue of that calculation Sep 12, 2019
@dreampiggy dreampiggy merged commit b4e72dd into master Sep 12, 2019
@dreampiggy dreampiggy deleted the fix_animated_webp_frame_blend_issue branch September 12, 2019 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant