openzim / python-scraperlib

Collection of Python code to re-use across Python-based scrapers
GNU General Public License v3.0
18 stars 16 forks source link

Image optimization on the fly (for JPEG/PNG/WebP) #75

Closed satyamtg closed 3 years ago

satyamtg commented 3 years ago

This adds image optimization on the fly for JPEG/WebP and PNG files. GIFs are not supported as I wasn't able to achieve any better compression than the original file in most of my tests using Pillow. Using gifsicle would mean not doing it "on the fly"

Here's a list of major changes -

Todo -

codecov[bot] commented 3 years ago

Codecov Report

Merging #75 (91bd685) into master (b895fc7) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #75   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          997      1007   +10     
=========================================
+ Hits           997      1007   +10     
Impacted Files Coverage Δ
src/zimscraperlib/image/optimization.py 100.00% <100.00%> (ø)
src/zimscraperlib/image/probing.py 100.00% <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 b895fc7...91bd685. Read the comment docs.