app/models/cropper/upload.rb
def read_dimensions
      if uploaded_file = self.file.queued_for_write[:original]
        file = uploaded_file.send :destination
        Rails.logger.warn "+++ getting geometry from queued file #{file.inspect}."
        Rails.logger.warn "--- File exist? #{File.exist?(file).inspect}"
        geometry = Paperclip::Geometry.from_file(file)
        self.original_width = geometry.width
        self.original_height = geometry.height
        self.original_extension = File.extname(file.path)
      end
      true
    end
# *read_dimensions* is called after post processing to record in the database the original width, height 
# and extension of the uploaded file. At this point the file queue will not have been flushed but the upload
# should be in place. We grab dimensions from the temp file and calculate thumbnail dimensions later, on demand.
#
read_dimensions* is called after post processing to record in the database the original width, height
and extension of the uploaded file. At this point the file queue will not have been flushed but the upload
should be in place. We grab dimensions from the temp file and calculate thumbnail dimensions later, on demand.
read_dimensions * is called after post processing to record in the database the original width height and extension of the uploaded file . At this point the file queue will not have been flushed but the upload should be in place . We grab dimensions from the temp file and calculate thumbnail dimensions later on demand .
def read_dimensions
      if uploaded_file = self.file.queued_for_write[:original]
        file = uploaded_file.send :destination
        Rails.logger.warn "+++ getting geometry from queued file #{file.inspect}."
        Rails.logger.warn "--- File exist? #{File.exist?(file).inspect}"
        geometry = Paperclip::Geometry.from_file(file)
        self.original_width = geometry.width
        self.original_height = geometry.height
        self.original_extension = File.extname(file.path)
      end
      true
    end
def read_dimensions if uploaded_file = self . file . queued_for_write [ :original ] file = uploaded_file . send :destination Rails . logger . warn "+++ getting geometry from queued file #{file.inspect}." Rails . logger . warn "--- File exist? #{File.exist?(file).inspect}" geometry = Paperclip :: Geometry . from_file ( file ) self . original_width = geometry . width self . original_height = geometry . height self . original_extension = File . extname ( file . path ) end true end
read_dimensions* is called after post processing to record in the database the original width, height
and extension of the uploaded file.
read_dimensions * is called after post processing to record in the database the original width height and extension of the uploaded file .