v2ex / remote

Remote Worker
https://www.v2ex.com/go/dev
MIT License
80 stars 4 forks source link

Add support to rescale animated PNG(APNG)/GIF/WEBP #30

Closed stdc105 closed 2 years ago

stdc105 commented 2 years ago

PNG(APNG)

GIF

WEBP

Functions

stdc105 commented 2 years ago

cc @luxiaba

stdc105 commented 2 years ago

Seems like I also need to tweak my black config.

luxiaba commented 2 years ago

Seems like I also need to tweak my black config.

No need config black alone, you can use pre-commit to hold all lints or check.

Install hooks for git push / commit / ..., it'll help you to do it every moment: pre-commit install --hook-type GIT_HOOK_NAME or Use pre-commit run --all-files to check all files when you want to check.

livid commented 2 years ago

Pull request should not push image to Docker.

stdc105 commented 2 years ago

There is currently a bug on animated APNG output: frames seem to be glitched when converting GIF to APNG. I cannot reproduce on all GIFs, but here is a problematic example: Original GIF (our favortie nyan cat): gif Resized GIF: test

The glitch effect can be reproduced on all resize sizes, with or without a default image prepend to the frames, and both in dev Docker container and on Windows.

codecov-commenter commented 2 years ago

Codecov Report

Merging #30 (c2794c5) into main (306d5fc) will decrease coverage by 3.85%. The diff coverage is 54.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   93.91%   90.06%   -3.86%     
==========================================
  Files          17       17              
  Lines        1003     1047      +44     
  Branches      122      135      +13     
==========================================
+ Hits          942      943       +1     
- Misses         41       83      +42     
- Partials       20       21       +1     
Flag Coverage Δ
unittests 90.06% <54.63%> (-3.86%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
remote/blueprints/image.py 60.37% <36.36%> (-23.39%) :arrow_down:
remote/utilities/image.py 85.25% <93.10%> (+0.84%) :arrow_up:
remote/app.py 93.54% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 306d5fc...c2794c5. Read the comment docs.