Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storage-resize-images): add WEBP and GIF animation #875

Conversation

posiek07
Copy link
Contributor

@posiek07 posiek07 commented Feb 4, 2022

fix: #590
fix: #797
fix: #696

Issue

No animated image support

Solution

Animated webp and gif images support. Newest Sharp ver. 0.30 library started supporting it out of the box.

Jobs

  • update sharp v0.30
  • remove depracated sharp types
  • add animated option for webp and gif output
  • add IS_ANIMATED and FUNCTION_MEMORY parameter
  • add unit tests

Tests

Screenshot 2022-02-04 at 16 56 53

Converting to animated (2gb RAM memory needed for bigger GIFs output)

Test Video
https://user-images.githubusercontent.com/64485499/152592141-59a39cbb-7efb-4200-8135-0fd5eb73025a.mov

Screenshot 2022-02-04 at 16 57 04
Screenshot 2022-02-04 at 18 30 50

Converting to First frame (512mb RAM memory)

Test Video
https://user-images.githubusercontent.com/64485499/152592664-0ac08c53-5d3b-4155-b57b-9bdf3b31fa8a.mov

Screenshot 2022-02-04 at 18 54 28
Screenshot 2022-02-04 at 18 57 30

@posiek07 posiek07 requested a review from a team as a code owner February 4, 2022 19:41
@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2022

Codecov Report

Merging #875 (248a6e7) into next (cfafb27) will increase coverage by 0.11%.
The diff coverage is 85.72%.

❗ Current head 248a6e7 differs from pull request most recent head 8263583. Consider uploading reports for the commit 8263583 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #875      +/-   ##
==========================================
+ Coverage   46.23%   46.34%   +0.11%     
==========================================
  Files          34       34              
  Lines        1469     1472       +3     
  Branches      215      217       +2     
==========================================
+ Hits          679      682       +3     
  Misses        789      789              
  Partials        1        1              
Impacted Files Coverage Δ
...torage-resize-images/functions/src/resize-image.ts 41.10% <83.34%> (+1.66%) ⬆️
storage-resize-images/functions/src/config.ts 100.00% <100.00%> (ø)

@dackers86 dackers86 changed the title feat(storage-resize-images): add WEBP and GIF animation 🎉 feat(storage-resize-images): add WEBP and GIF animation Feb 7, 2022
@pavelgj pavelgj merged commit a34ea63 into firebase:next Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants