Sha256: 62478ea1c76b2d8761a8c482c1a4e82e599872d58bfe9c8daffb0dccf301ea71

Contents?: true

Size: 355 Bytes

Versions: 8

Compression:

Stored size: 355 Bytes

Contents

require 'RMagick'

namespace :retina_image_tag do
  desc 'convert @2x images to normal images'
  task :convert do
    retina_images = Dir['app/assets/images/**/*@2x*']
      
    retina_images.each do |retina_image|
      img = Magick::ImageList.new(retina_image)
      x1 = img.resize(0.5)
      x1.write retina_image.delete "@2x"
    end
    
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
retina_image_tag-1.0.3 lib/tasks/retina_image_tag.rake
retina_image_tag-1.0.2 lib/tasks/retina_image_tag.rake
retina_image_tag-1.0.1 lib/tasks/retina_image_tag.rake
retina_image_tag-1.0.0 lib/tasks/retina_image_tag.rake
retina_image_tag-0.0.13 lib/tasks/retina_image_tag.rake
retina_image_tag-0.0.11 lib/tasks/retina_image_tag.rake
retina_image_tag-0.0.10 lib/tasks/retina_image_tag.rake
retina_image_tag-0.0.9 lib/tasks/retina_image_tag.rake