Sha256: afdbf848e749ad812dec1bccd6d4a4c496c544feec762d081a619ab5a4d265f3

Contents?: true

Size: 966 Bytes

Versions: 1

Compression:

Stored size: 966 Bytes

Contents

require "crop_pokemori_prof_image/version"
require 'crop_pokemori_prof_image/create_crop_image'
require 'crop_pokemori_prof_image/is_pokemori_prof_image'

module CropPokemoriProfImage
  extend self
  extend CreateCropImage
  extend IsPokemoriProfImage

  def crop_single_image(image_file, output_directory='crop_image')
    image_file = change_to_fullpath(image_file)
    @output_directory = output_directory

    crop_image_initialize(image_file)
    create_crop_image(image_file) if pokemori_prof_image?(@normalize_image_file)
    remove_image_file(@normalize_image_file)
  end

  def crop_multiple_image(input_directory='.', output_directory='crop_image')
    image_files = Pathname.glob("#{change_to_fullpath(input_directory)}/*").select do |filename|
       filename.to_s =~ /\A.*(\.jpg|\.png)\z/
    end
    @output_directory = output_directory

    image_files.each do |image_file|
      crop_single_image(image_file.to_s, output_directory)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crop_pokemori_prof_image-0.1.0 lib/crop_pokemori_prof_image.rb