Skip to content

Commit

Permalink
add a jpegoptim filter that converts images to progressive scan
Browse files Browse the repository at this point in the history
  • Loading branch information
gwax committed May 4, 2017
1 parent e35b172 commit a062754
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* `Felix Schwarz <https://github.com/FelixSchwarz>`_
* `Florian Finkernagel <https://github.com/TyberiusPrime>`_
* `follower <https://github.com/follower>`_
* `George Leslie-Waksman <https://github.com/gwax>`_
* `Grzegorz Śliwiński <https://github.com/fizyk>`_
* `Guillermo O. Freschi <https://github.com/Tordek>`_
* `Hardening <https://github.com/hardening>`_
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Features
* Include KaTeX CSS automatically when needed (Issue #2715)
* Split out math code into new ``math_helper.tmpl`` template (Issue
#2715)
* Added ``jpegoptim_progressive`` filter to convert jpeg images to progressive
jpegs.

Bugfixes
--------
Expand Down
6 changes: 6 additions & 0 deletions nikola/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ def jpegoptim(infile, executable='jpegoptim'):
return runinplace("{} -p --strip-all -q %1".format(executable), infile)


@_ConfigurableFilter(executable='JPEGOPTIM_EXECUTABLE')
def jpegoptim_progressive(infile, executable='jpegoptim'):
"""Run jpegoptim on a file and convert to progressive."""
return runinplace("{} -p --strip-all --all-progressive -q %1".format(executable), infile)


@_ConfigurableFilter(executable='HTML_TIDY_EXECUTABLE')
def html_tidy_withconfig(infile, executable='tidy5'):
"""Run HTML Tidy with tidy5.conf as config file."""
Expand Down

0 comments on commit a062754

Please sign in to comment.