Skip to content

Commit

Permalink
optimize_png: Accept second parameter specifying path to optipng.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed Nov 15, 2011
1 parent ab243a7 commit df270a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions r2/r2/lib/nymph.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
sprite_line = re.compile(r"background-image: *url\((.*)\) *.*/\* *SPRITE *(stretch-x)? *\*/")


def optimize_png(filename):
def optimize_png(filename, optimizer='/usr/bin/env optipng'):
with open(os.path.devnull, 'w') as devnull:
subprocess.check_call(['/usr/bin/env', 'optipng', filename], stdout=devnull)
subprocess.check_call(' '.join((optimizer, filename)), shell=True, stdout=devnull)


def _extract_css_info(match):
Expand Down

0 comments on commit df270a0

Please sign in to comment.