commit 44028f86d2b4807e71d04ef75c54cef50718c130 Author: Sean Date: Mon Jun 10 19:52:00 2019 -0700 Initial Commit diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..3bd28de --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +gem 'mini_magick' diff --git a/file_nav.rb b/file_nav.rb new file mode 100644 index 0000000..cc3724a --- /dev/null +++ b/file_nav.rb @@ -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 diff --git a/stickerizer.rb b/stickerizer.rb new file mode 100644 index 0000000..338d737 --- /dev/null +++ b/stickerizer.rb @@ -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