frameit/lib/frameit/editor.rb
# Returns a correctly sized background image
Returns a correctly sized background image
Returns a correctly sized background image
def generate_background
      background = MiniMagick::Image.open(fetch_config['background'])
      if background.height != screenshot.size[1]
        background.resize("#{screenshot.size[0]}x#{screenshot.size[1]}^") 
        background.merge!(["-gravity", "center", "-crop", "#{screenshot.size[0]}x#{screenshot.size[1]}+0+0"]) 
      end
      background
    end
def generate_background background = MiniMagick :: Image . open ( fetch_config [ 'background' ] ) if background . height != screenshot . size [ 1 ] background . resize ( "#{screenshot.size[0]}x#{screenshot.size[1]}^" ) background . merge! ( [ "-gravity" , "center" , "-crop" , "#{screenshot.size[0]}x#{screenshot.size[1]}+0+0" ] ) end background end
Returns a correctly sized background image
Returns a correctly sized background image
# `^` says it should fill area # crop from center