Sha256: 416a882d8b21c8c233355cde8edca54f49d7d843a9c4864a556e79dae893b61e
Contents?: true
Size: 268 Bytes
Versions: 14
Compression:
Stored size: 268 Bytes
Contents
module ImagesHelper def image_width_for_height(filename, target_height) source_width, source_height = FastImage.size("#{Rails.root}/app/javascript/images/#{filename}") ratio = source_width.to_f / source_height.to_f (target_height * ratio).to_i end end
Version data entries
14 entries across 14 versions & 1 rubygems