Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Fixes method of accessing Yaml settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
joegatt committed Jun 30, 2013
1 parent e1332c3 commit b49a79f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/helpers/resources_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ module ResourcesHelper
include EffectsHelper

# REVIEW: Does this duplicate Resource#cut_location? Or maybe this should be a separate Class?
# Dervie from: https://github.com/carrierwaveuploader/carrierwave/blob/92c817bb7b1c821d8021d3fd1ded06551b1d9a01/lib/carrierwave/processing/mini_magick.rb
# Derive from: https://github.com/carrierwaveuploader/carrierwave/blob/92c817bb7b1c821d8021d3fd1ded06551b1d9a01/lib/carrierwave/processing/mini_magick.rb
# And: https://gist.github.com/tonycoco/2910540

def cut_image_binary_path(image, options = {})
type = options[:type] || 'standard'

Rails.application.routes.url_helpers.cut_resource_path(
file_name: image.local_file_name,
aspect_x: options[:aspect_x] || Settings.styling.images[type][:aspect][:x],
aspect_y: options[:aspect_y] || Settings.styling.images[type][:aspect][:y],
width: options[:width] || Settings.styling.images[type][:width],
aspect_x: options[:aspect_x] || Settings.styling.images[type]['aspect']['x'],
aspect_y: options[:aspect_y] || Settings.styling.images[type]['aspect']['y'],
width: options[:width] || Settings.styling.images[type]['width'],
snap: options[:snap] || Settings.styling.images.snap,
gravity: options[:gravity] || Settings.styling.images.gravity,
effects: options[:effects] || image.note.fx,
Expand Down

0 comments on commit b49a79f

Please sign in to comment.