Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all of the geometry strings #53

Merged
merged 1 commit into from
Nov 18, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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