Skipping frames for Animated WebP
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- objective-c
- Domain
- mobile-dev
Research direction
Start in SDImageWebPCoder.m around line 264, where animated WebP frames are decoded and durations are collected. Determine how an opt-in frame-skipping option should be exposed and preserved across supported Apple platforms, then verify the resulting frame count and animation timing with an animated WebP fixture.
Written by the indexing model from the issue text.
Description
It would be good to have an option to skip frames for animated webP.
If I have a thumbnail trying to render an animated wepb image with 120 frames it could be good to render only 30 frames, to preserve speed and memory.
Maybe not the first 30 frames but skipping frames in a loop: the animation will not be very smooth obviously.
A simple, not nice looking solution to skip half of the frames:
SDImageWebPCoder.m
line 264
Adding a skipper in the loop and duplicating the duration
int skipper = 0;
do {
skipper++;
if ((skipper %2) == 0) {
continue;
}
@autoreleasepool {
CGImageRef imageRef = [self sd_drawnWebpImageWithCanvas:canvas iterator:iter colorSpace:colorSpace scaledSize:scaledSize];
if (!imageRef) {
continue;
}
#if SD_UIKIT || SD_WATCH
UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
#else
UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:kCGImagePropertyOrientationUp];
#endif
CGImageRelease(imageRef);
NSTimeInterval duration = [self sd_frameDurationWithIterator:iter];
SDImageFrame *frame = [SDImageFrame frameWithImage:image duration:(duration*2)];
[frames addObject:frame];
}
} while (WebPDemuxNextFrame(&iter));
- Dominant language
- Objective-C
- Stars
- 277
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SDWebImage/SDWebImageWebPCoder
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
SDWebImage/SDWebImageWebPCoder#117 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
SDWebImage/SDWebImageWebPCoder#116 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
SDWebImage/SDWebImageWebPCoder#115 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
SDWebImage/SDWebImageWebPCoder#113 · 3 comments ·
-
Frames loading Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
SDWebImage/SDWebImageWebPCoder#105 · 15 comments ·
All issues in SDWebImage/SDWebImageWebPCoder
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
obsproject/obs-studio#13918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HigherOrderCO/Bend#842 · 2 comments ·