Sha256: f840e61fb3af65f8734b39242897b1e73b623610e0c00c2603a773ed2af4ade2

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

module ImageHelpers

  BASE_PATH = '../files/'

  class << self

    def get_image(file_name)
      Magick::Image.read(File.expand_path(BASE_PATH + file_name, __FILE__)).first
    end

    # Images

    def test0_image
      get_image('test3.jpg')
    end

    def greenline_image
      get_image 'greenlineimage.jpg'
    end

    def ocr_image
      get_image 'test4.jpg'
    end

    def barcode_image
      get_image 'test_barcode.jpg'
    end

    def labels_image
      get_image 'types_8.jpg'
    end

    def foo3_image
      get_image 'foo3.jpg'
    end

    # Images for boundary tests (otherwise empty)

    def standard_cross_green
      get_image 'boundary_cross_green.jpg'
    end

    def crossy_green_line_specimen
      get_image 'CrossyGreenLinesSpecimen.jpg'
    end
    def crossy_black_line_specimen
      get_image 'CrossyBlackLinesSpecimen.jpg'
    end

    def black_stage_green_line_specimen
      get_image 'black_stage_green_line_specimen.jpg'
    end

    def black_stage_green_line_specimen_label
      get_image 'label_images/black_stage_green_line_specimen_label.jpg'
    end

    def offset_cross_red
      get_image 'boundary_offset_cross_red.jpg'
    end

    def right_t_green
      get_image 'boundary_right_t_green.jpg'
    end

    def left_t_yellow
      get_image 'boundary_left_t_yellow.jpg'
    end

    def of_size(width = 1024, height = 768)
       Magick::Image.new(width, height) {
        self.background_color = 'white'
      }
    end

  end 

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sqed-0.0.4 spec/support/image_helpers.rb