module AttachmentSaver::Processors::GdkPixbuf::Operations
Attributes
file_extension[RW]
format[RW]
Public Instance Methods
crop_to(new_width, new_height, &block)
click to toggle source
# File lib/processors/gdk_pixbuf.rb, line 99 def crop_to(new_width, new_height, &block) # crops to the center method = respond_to?(:subpixbuf) ? :subpixbuf : :new_subpixbuf image = send(method, (width - new_width)/2, (height - new_height)/2, new_width, new_height) image.extend Operations image.format = format image.file_extension = file_extension block.call(image) end
resize_to(new_width, new_height, &block)
click to toggle source
# File lib/processors/gdk_pixbuf.rb, line 91 def resize_to(new_width, new_height, &block) image = scale(new_width, new_height) image.extend Operations image.format = format image.file_extension = file_extension block.call(image) end