Module: ImageProcessing::Vips::Processor::Utils
- Defined in:
- lib/image_processing/vips.rb
Class Method Summary collapse
- .select_valid_loader_options(source_path, options) ⇒ Object
- .select_valid_options(operation_name, options) ⇒ Object
- .select_valid_saver_options(destination_path, options) ⇒ Object
Class Method Details
.select_valid_loader_options(source_path, options) ⇒ Object
122 123 124 125 |
# File 'lib/image_processing/vips.rb', line 122 def (source_path, ) loader = ::Vips.vips_foreign_find_load(source_path) loader ? (loader, ) : end |
.select_valid_options(operation_name, options) ⇒ Object
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/image_processing/vips.rb', line 132 def (operation_name, ) operation = ::Vips::Operation.new(operation_name) = operation.get_construct_args .select { |name, flags| (flags & ::Vips::ARGUMENT_INPUT) != 0 } .select { |name, flags| (flags & ::Vips::ARGUMENT_REQUIRED) == 0 } .map(&:first).map(&:to_sym) .select { |name, value| .include?(name) } end |
.select_valid_saver_options(destination_path, options) ⇒ Object
127 128 129 130 |
# File 'lib/image_processing/vips.rb', line 127 def (destination_path, ) saver = ::Vips.vips_foreign_find_save(destination_path) saver ? (saver, ) : end |