Sha256: ac6a22f7e23995becd46b7350accb71b9f3fdc2e03c701bdb47f51de70b972a3
Contents?: true
Size: 687 Bytes
Versions: 2
Compression:
Stored size: 687 Bytes
Contents
module Similatron class ImagemagickComparisonEngine < ComparisonEngine def can_handle_mime?(mime_type) [/image/, /application.pdf/].any? do |format| mime_type =~ format end end private def default_executable_path "compare" end def diff_extension "jpg" end def command(expected, actual, diff_path) "#{executable_path} -metric PSNR #{expected} #{actual} #{diff_path}" end def diff(diff_path, exec_result) exec_result.status == 1 ? diff_path : nil end def score(exec_result) if exec_result.status == 2 100 else exec_result.err.to_i end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
similatron-0.1.1 | lib/similatron/imagemagick_comparison_engine.rb |
similatron-0.1.0 | lib/similatron/imagemagick_comparison_engine.rb |