Initial Commit

This commit is contained in:
Sean 2019-06-10 19:52:00 -07:00
commit 44028f86d2
3 changed files with 46 additions and 0 deletions

4
Gemfile Normal file
View file

@ -0,0 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'mini_magick'

30
file_nav.rb Normal file
View file

@ -0,0 +1,30 @@
# frozen_string_literal: true
class DirTermine
def initialize
@save_dir = save_dir
@to_resize = to_resize
end
def destination_dir
puts 'Please enter desired save directory (Leave blank for ~/Pictures/stickerized)'
dir = gets.chomp
end
def origin_dir
puts 'Please enter directory containing pictures to stickerize (Leave blank for current directory)'
dir = gets.chomp
end
def dir_check(path)
if Dir.exists?(File.expand_path(path))
else
end
end
end
testr = DirTermine.new
testr.save_dir

12
stickerizer.rb Normal file
View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
require 'mini_magick'
class Stickerizer
def stickerize(pic_file, save_dir)
image = MiniMagick::Image.open(pic_file)
image.resize '512x512'
image.format 'png'
image.write "#{save_dir}#{pic_file}"
end
end