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
141 142 143 144 |
# File 'lib/image_processing/vips.rb', line 141 def (source_path, ) loader = ::Vips.vips_foreign_find_load(source_path) loader ? (loader, ) : end |
.select_valid_options(operation_name, options) ⇒ Object
151 152 153 154 155 156 157 158 159 160 |
# File 'lib/image_processing/vips.rb', line 151 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
146 147 148 149 |
# File 'lib/image_processing/vips.rb', line 146 def (destination_path, ) saver = ::Vips.vips_foreign_find_save(destination_path) saver ? (saver, ) : end |