method

process

rails latest stable - Class: ActiveStorage::Transformers::MiniMagickTransformer

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.0.0) is shown here.

process(file, format:)
private

No documentation available.

# File activestorage/lib/active_storage/transformers/mini_magick_transformer.rb, line 9
        def process(file, format))
          image = MiniMagick::Image.new(file.path, file)

          transformations.each do |name, argument_or_subtransformations|
            image.mogrify do |command|
              if name.to_s == "combine_options"
                argument_or_subtransformations.each do |subtransformation_name, subtransformation_argument|
                  pass_transform_argument(command, subtransformation_name, subtransformation_argument)
                end
              else
                pass_transform_argument(command, name, argument_or_subtransformations)
              end
            end
          end

          image.format(format) if format

          image.tempfile.tap(&:open)
        end