Skip to content

Conversation

dreampiggy
Copy link
Contributor

See thumbnail decoding PR: SDWebImage/SDWebImage#2922

@dreampiggy dreampiggy requested a review from kinarobin January 16, 2020 14:14
@dreampiggy dreampiggy changed the title WebPCoder now supports the thumbnail decoding WIP: WebPCoder now supports the thumbnail decoding Jan 16, 2020
@dreampiggy dreampiggy changed the title WIP: WebPCoder now supports the thumbnail decoding WebPCoder now supports the thumbnail decoding Jan 17, 2020
@dreampiggy dreampiggy force-pushed the feature_thumbnail_decoding branch from 64b24a0 to 531a096 Compare January 17, 2020 16:38
…ause the draw frame contains Jagged and buggy. Instead, use the full pixels canvas to draw, scale down each frame after drawn (sadlly)
@dreampiggy dreampiggy force-pushed the feature_thumbnail_decoding branch 2 times, most recently from 18e46b3 to 4152405 Compare January 17, 2020 17:04
@dreampiggy
Copy link
Contributor Author

dreampiggy commented Jan 17, 2020

I previously enter the trap, to use the thumbnail pixel count to create a canvas and draw, however, this is wrong.

For Animated WebP, we must always use the full pixel count canvas, draw each frame to follows WebP standard. This canvas RAM usage can not been saved.

This is because, each frame contains the offset and size to place, however, if we scaled them down, some edge will loss details, the final blend on the canvas will cause glitch.... A little suck :(

See the video about what I means (using the smaller canvas to draw):

Animated WebP Bug when using smaller canvas.mov.zip

So, finally, I have to use CGImageCreatedScaled() to scale down the drawn frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant