From 44028f86d2b4807e71d04ef75c54cef50718c130 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 10 Jun 2019 19:52:00 -0700 Subject: [PATCH] Initial Commit --- Gemfile | 4 ++++ file_nav.rb | 30 ++++++++++++++++++++++++++++++ stickerizer.rb | 12 ++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 Gemfile create mode 100644 file_nav.rb create mode 100644 stickerizer.rb 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