SDWebImage / SDWebImage/SDWebImageWebPCoder
Skipping frames for Animated WebP
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Objective-C
- Estrellas
- 277
- Forks
- 101
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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));
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en SDImageWebPCoder.m, alrededor de la línea 264, donde se decodifican los frames WebP animados y se recopilan sus duraciones. Determina cómo debería exponerse y conservarse una opción de omisión de frames activable explícitamente en las plataformas Apple compatibles y, después, verifica el recuento de frames resultante y la temporización de la animación con un fixture WebP animado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- objective-c
- Área
- mobile-dev
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100