Initial Commit
This commit is contained in:
commit
44028f86d2
4
Gemfile
Normal file
4
Gemfile
Normal file
|
@ -0,0 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
gem 'mini_magick'
|
30
file_nav.rb
Normal file
30
file_nav.rb
Normal 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
12
stickerizer.rb
Normal 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
|
Loading…
Reference in a new issue