Method: Paperclip.options

Defined in:
lib/paperclip.rb

.optionsObject

Provides configurability to Paperclip. The options available are:

  • whiny: Will raise an error if Paperclip cannot process thumbnails of an uploaded image. Defaults to true.
  • log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors log levels, etc. Defaults to true.
  • command_path: Defines the path at which to find the command line programs if they are not visible to Rails the system's search path. Defaults to nil, which uses the first executable found in the user's search path.
  • use_exif_orientation: Whether to inspect EXIF data to determine an image's orientation. Defaults to true.


101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/paperclip.rb', line 101

def self.options
  @options ||= {
    command_path: nil, # @deprecated Will be removed in Paperclip 8.0.
    file_command_path: nil,
    imagemagick_path: nil,
    content_type_mappings: {},
    imagemagick_version: nil,
    log: true,
    log_command: true,
    read_timeout: nil,
    swallow_stderr: true,
    use_exif_orientation: true,
    whiny: true,
    is_windows: Gem.win_platform?,
    add_validation_errors_to: :both
  }
  if @options[:command_path]
    Paperclip.deprecator.warn(
      "Paperclip.options[:command_path] will be removed in Paperclip 8.0. Please use " \
      "Paperclip.options[:imagemagick_path] and/or Paperclip.options[:file_command_path] instead."
    )
  end
  @options
end