app/models/user.rb
#returns tiffed disk usage in units of bytes
returns tiffed disk usage in units of bytes
returns tiffed disk usage in units of bytes
def calculate_disk_usage
    user_own_maps = self.own_maps  
    files = user_own_maps.map{|m| m.unwarped_filename if File.exist? m.unwarped_filename} + user_own_maps.map{| m | m.masked_src_filename if File.exist? m.masked_src_filename} + user_own_maps.map{|m | m.warped_filename if File.exist? m.warped_filename} + user_own_maps.map{|m| m.warped_png_filename if File.exist? m.warped_png_filename}
    files.compact!
    total_size = files.inject(0) {| result, file | result + File.size(file) }
    return total_size
  end
def calculate_disk_usage user_own_maps = self . own_maps files = user_own_maps . map { | m | m . unwarped_filename if File . exist? m . unwarped_filename } + user_own_maps . map { | m | m . masked_src_filename if File . exist? m . masked_src_filename } + user_own_maps . map { | m | m . warped_filename if File . exist? m . warped_filename } + user_own_maps . map { | m | m . warped_png_filename if File . exist? m . warped_png_filename } files . compact! total_size = files . inject ( 0 ) { | result , file | result + File . size ( file ) } return total_size end
returns tiffed disk usage in units of bytes
returns tiffed disk usage in units of bytes
#saves 4 calls