bin/image_voodoo in image_voodoo-0.8.2 vs bin/image_voodoo in image_voodoo-0.8.3
- old
+ new
@@ -14,11 +14,11 @@
opts.separator "Actions are meant to be chained. Examples:"
opts.separator " # Print the dimensions"
opts.separator " image_voodoo --dim small.jpg"
opts.separator ""
opts.separator " # Convert to a thumbnail, preview, and then save the result"
- opts.separator " image_voodoo --thumb 50 --preview --save thumb.png large.jpg"
+ opts.separator " image_voodoo --thumbnail 50 --preview --save thumb.png large.jpg"
opts.separator ""
opts.separator " # Convert source to 3 thumbnails, showing dimensions and"
opts.separator " # previewing along the way"
opts.separator " image_voodoo --dim --resize 50x50 --dim --preview --save t1.jpg"
opts.separator " --pop --resize 40x40 --dim --preview --save t2.jpg"
@@ -33,17 +33,17 @@
end
actions << lambda {|img| img.alpha(c) }
end
opts.on("-b", "--brightness SCALE,OFFSET", "Adjust brightness") do |args|
- scale, offset = args.split(/\,/i).map {|v| v.to_f}
+ scale, offset = args.split(/,/).map {|v| v.to_f}
opts.usage "You need to specify proper scale and offset" unless scale && offset
actions << lambda {|img| img.adjust_brightness(scale, offset) }
end
opts.on("-B", "--border WIDTH,COLOR,STYLE", "Add a simple border") do |args|
- width, color, style = args.split(/\,/i)
+ width, color, style = args.split(/,/)
options = {:width => width, :color => color, :style => style }
actions << lambda {|img| img.add_border(options) }
end
@@ -59,9 +59,13 @@
actions << lambda {|img| img.flip_horizontally }
end
opts.on("-n", "--negative", "Make a negative out of the image") do
actions << lambda {|img| img.negative }
+ end
+
+ opts.on("-q", "--quality 0..1", Float, "Set % of quality for lossy compression") do |quality|
+ actions << lambda {|img| img.quality(quality) }
end
opts.on("-s", "--save FILENAME", "Save the results to a new file") do |f|
actions << lambda {|img| img.save(f); img }
end