-
-
Save akasper/960654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def size_upload | |
result = {:export => {use: []}} | |
return result unless self.uploads_enabled? | |
result[:resize] = result[:encode] = { | |
width: self.upload_width, | |
height: self.upload_height | |
} if self.upload_width? && self.upload_height? | |
result[:resize_thumb] = result[:encode_thumb] = { | |
width: self.upload_thumb_width, | |
height: self.upload_thumb_height | |
} if self.upload_thumb_width? && self.upload_thumb_height? | |
result[:export][:use].push("resize").push("resize_thumb") if self.enable_images? | |
result[:export][:use].push("encode").push("encode_thumb") if self.enable_videos? | |
result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment