Sha256: ecb447a3b727a5e6cef541e6be527c101a25ce000019e39a9949967a3e2f5d5c

Contents?: true

Size: 1023 Bytes

Versions: 6

Compression:

Stored size: 1023 Bytes

Contents

# encoding: utf-8
require 'light_resizer/image_loader/original_image'
require 'light_resizer/image_loader/resize_image'

module LightResizer
  class ImageLoader

    attr_reader :original, :resized

    def initialize(root_dir)
      @original = ImageLoader::OriginalImage.new(root_dir)
      @resized = ImageLoader::ResizeImage.new(root_dir)
    end

    def original_image_path=(path)
      #todo refresh @original image
      @original.relative_path = path
    end

    def resize_prefix=(prefix)
      #todo clear resize prefix
      @resized.original_filename = @original.filename
      @resized.original_relative_dir = @original.relative_dir
      @resized.resize_prefix = prefix
    end

    def original_path
      @original.full_path
    end

    def original_image_exist?
      @original.image_exist?
    end

    def resize_path
      @resized.full_path
    end

    def resized_image_relative_path
      @resized.relative_path
    end

    def resized_image_exist?
      @resized.image_exist?
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
light_resizer-0.1.7 lib/light_resizer/image_loader.rb
light_resizer-0.1.6 lib/light_resizer/image_loader.rb
light_resizer-0.1.4 lib/light_resizer/image_loader.rb
light_resizer-0.1.2 lib/light_resizer/image_loader.rb
light_resizer-0.1.1 lib/light_resizer/image_loader.rb
light_resizer-0.0.2 lib/light_resizer/image_loader.rb