openzim / python-scraperlib

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

Better defaults for convert_image() #44

Closed rgaudin closed 4 years ago

rgaudin commented 4 years ago

Pillow automatically uses the destination filename extension to guess format when saving an Image. It seems odd that we require the destination format separately.

With this, the format is now optionnal (as fmt arg). It is also normalized as Pillow uses all-upercase formats.

colorspace argument is also moved to keyword arguments as its use is unlikely while setting save parameters should be a lot more common.

codecov[bot] commented 4 years ago

Codecov Report

Merging #44 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #44   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          780       783    +3     
=========================================
+ Hits           780       783    +3     
Impacted Files Coverage Δ
src/zimscraperlib/download.py 100.00% <ø> (ø)
src/zimscraperlib/imaging.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 2e082bf...b045c63. Read the comment docs.

rgaudin commented 4 years ago

Oh right, I forgot ; will do