@@ -9,22 +9,26 @@ class WebpExec
99 # Runs the WebP executable for the given input parameters
1010 # the function detects the OS platform and architecture automatically
1111 #
12- def self . run ( quality , flags , input_file , output_file )
12+ def self . run ( quality , flags , input_file , output_file , webp_bin_fullpath )
1313
14- # What is the path to the execs inside the gem? perhaps just bin/?
15- bin_path = "bin/"
14+ if webp_bin_fullpath
15+ full_path = webp_bin_fullpath
16+ else
17+ # What is the path to the execs inside the gem? perhaps just bin/?
18+ bin_path = "bin/"
1619
17- # What is the OS and architecture specific executable name?
18- exe_name = WebpExec . exe_name
20+ # What is the OS and architecture specific executable name?
21+ exe_name = WebpExec . exe_name
1922
20- # We need to locate the Gems bin path as we're currently running inside the
21- # jekyll site working directory
22- # http://stackoverflow.com/a/10083594/779521
23- gem_spec = Gem ::Specification . find_by_name ( "jekyll-webp" )
24- gem_root = gem_spec . gem_dir
23+ # We need to locate the Gems bin path as we're currently running inside the
24+ # jekyll site working directory
25+ # http://stackoverflow.com/a/10083594/779521
26+ gem_spec = Gem ::Specification . find_by_name ( "jekyll-webp" )
27+ gem_root = gem_spec . gem_dir
2528
26- # Construct the full path to the executable
27- full_path = File . join ( gem_root , bin_path , exe_name )
29+ # Construct the full path to the executable
30+ full_path = File . join ( gem_root , bin_path , exe_name )
31+ end
2832
2933 # Construct the full program call
3034 cmd = "\" #{ full_path } \" -quiet -mt -q #{ quality . to_s } #{ flags } \" #{ input_file } \" -o \" #{ output_file } \" "
0 commit comments