Skip to content

Commit

Permalink
Merge pull request #53 from kausters/master
Browse files Browse the repository at this point in the history
Support all of the geometry strings
  • Loading branch information
jhnvz committed Nov 18, 2014
2 parents c415abb + a586988 commit 0f55471
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/retina_rails/strategies/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,8 @@ def optimize_retina!(name)

## Iterate over styles and set optimzed dimensions
styles.each_pair do |key, value|

dimensions = value.kind_of?(Array) ? value[0] : value

width = dimensions.scan(/\d+/)[0].to_i * 2
height = dimensions.scan(/\d+/)[1].to_i * 2

processor = dimensions.scan(/#|</).first

new_dimensions = "#{width}x#{height}#{processor}"
new_dimensions = dimensions.gsub(/\d+/) { |dimension| dimension.to_i * 2}
retina_styles[key.to_sym] = value.kind_of?(Array) ? [new_dimensions, value[1]] : new_dimensions

## Set quality convert option
Expand Down

0 comments on commit 0f55471

Please sign in to comment.