Sha256: da1fcb7733a33e3769b7dcd296de4564f637b220d687d1127783991e5c17fbe4
Contents?: true
Size: 591 Bytes
Versions: 6
Compression:
Stored size: 591 Bytes
Contents
module Visdiff class Image attr_reader :identifier, :fullpath attr_accessor :client def initialize identifier, fullpath @identifier = identifier @fullpath = fullpath end def basename File.basename(fullpath) end def signature @signature ||= IO.popen(["identify", "-format", "%#", '--', fullpath]) do |f| f.read end end def submit! @client.submit_image self end def attributes {image: upload_io} end def upload_io Faraday::UploadIO.new(fullpath, 'image/png') end end end
Version data entries
6 entries across 6 versions & 1 rubygems