app/models/asset.rb
# at this point the file queue will not have been written
# but the upload should be in place. We read dimensions from the
# original file and calculate thumbnail dimensions later, on demand.
at this point the file queue will not have been written
but the upload should be in place. We read dimensions from the
original file and calculate thumbnail dimensions later, on demand.
at this point the file queue will not have been written but the upload should be in place . We read dimensions from the original file and calculate thumbnail dimensions later on demand .
def read_dimensions
    if image?
      if file = asset.queued_for_write[:original]
        geometry = Paperclip::Geometry.from_file(file)
        self.original_width = geometry.width
        self.original_height = geometry.height
        self.original_extension = File.extname(file.path)
      end
    end
    true
  end
def read_dimensions if image? if file = asset . queued_for_write [ :original ] geometry = Paperclip :: Geometry . from_file ( file ) self . original_width = geometry . width self . original_height = geometry . height self . original_extension = File . extname ( file . path ) end end true end
at this point the file queue will not have been written
but the upload should be in place.
at this point the file queue will not have been written but the upload should be in place .