Skip to content

Commit dd0d36f

Browse files
Emilio Del Tessandorosverrirs
authored andcommitted
more explanation of the flags
1 parent 0884bbe commit dd0d36f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/jekyll-webp/defaults.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ module Webp
1010
# https://developers.google.com/speed/webp/docs/cwebp#options
1111
'flags' => "-q 75",
1212

13+
# For best lossy compression use
14+
# 'flags' => "-q 100 -m 6 -pass 10 -af",
15+
16+
# For best lossless compression use
17+
# 'flags' => "-q 100 -lossless -z 9",
18+
1319
# List of directories containing images to optimize, Nested directories will not be checked
1420
'img_dir' => ["/img"],
1521

lib/jekyll-webp/webpExec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.run(flags, input_file, output_file)
1717
# What is the OS and architecture specific executable name?
1818
exe_name = WebpExec.exe_name
1919

20-
# We need to locate the Gems bin path as we're currently running inside the
20+
# We need to locate the Gems bin path as we're currently running inside the
2121
# jekyll site working directory
2222
# http://stackoverflow.com/a/10083594/779521
2323
gem_spec = Gem::Specification.find_by_name("jekyll-webp")
@@ -28,13 +28,13 @@ def self.run(flags, input_file, output_file)
2828

2929
# Construct the full program call
3030
cmd = "\"#{full_path}\" -quiet -mt #{flags} \"#{input_file}\" -o \"#{output_file}\""
31-
31+
3232
# Execute the command
3333
exit_code = 0
3434
error = ""
3535
output = ""
3636
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
37-
stdin.close # wo don't pass any input to the process
37+
stdin.close # we don't pass any input to the process
3838
output = stdout.gets
3939
error = stderr.gets
4040
exit_code = wait_thr.value
@@ -72,7 +72,7 @@ def self.exe_name
7272
end #function exe_name
7373

7474
end #class WebpExec
75-
75+
7676
end #module Webp
7777

7878
module OS

0 commit comments

Comments
 (0)