7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/image_genie/verify.rb', line 7
def self.run(filename, options={})
raise(UnableToLocateBinaryError, 'identify') if path_for(:identify).blank?
begin
raise Errno::ENOENT,"#{filename}" unless File.exists?(filename)
rescue Errno::ENOENT => e
logger.error("#{self.name} #{e.message}")
raise
end
command = "#{path_for(:identify)} #{filename}"
execute(command) do |pid,stdin,stdout,stderr|
ignored, status = Process::waitpid2 pid
handle_errors(stderr,status,VerifyError)
end
return true
end
|