title: Cannot retrieve Shrine metadata
body: <p>I am switching from Paperclip to Shrine because of Paperclip deprecation.</p>
  
  <p>In my model <code>Profilepic.rb</code> file I used to retrieve dimensions of an image variant as follow: </p>
  
  <pre><code>before_create  :save_ratio    
  
  def save_ratio
      geo = Paperclip::Geometry.from_file(image.queued_for_write[:original])
      self.ratio = geo.width / geo.height
    end
  </code></pre>
  
  <p>Basically I am saving the vertical ratio of an image. </p>
  
  <p>It was working well with Paperclip : I grabbed the temporary image <code>queued_for_write</code> and checked dimensions with <code>Paperclip::Geometry</code> before saving the value. </p>
  
  <p>In Shrine I have added the following to the uploader :</p>
  
  <pre><code>plugin :add_metadata
  plugin :store_dimensions
  </code></pre>
  
  <p>It works great as I have all information available and images are uploaded to S3 properly. </p>
  
  <p>Yet my new method for saving the image ratio no longer works : </p>
  
  <pre><code>after_create  :save_ratio
  def save_ratio
      self.ratio = self.image[:original].width.to_i / self.image[:original].height.to_i
    end
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p>error undefined method `[]' for
    ProfilepicUploader::UploadedFile:0x00007f69a685c750></p>
  </blockquote>
  
  <p>Whereas, in console, after image has been created :</p>
  
  <pre><code>Profilepic.first.image[:original].width.to_i
  </code></pre>
  
  <p>does return the correct value.</p>
  
  <p>EDIT</p>
  
  <p>My uploader : </p>
  
  <pre><code>require "image_processing/mini_magick"
  
  class ProfilepicUploader &lt; Shrine
      include ImageProcessing::MiniMagick
      plugin :processing
      plugin :validation_helpers # to validate image data
      plugin :versions
      plugin :add_metadata
      plugin :store_dimensions
  
      Attacher.validate do
          validate_max_size 5.megabyte
          validate_mime_type_inclusion ['image/jpg', 'image/jpeg', 'image/png']
      end
  
      process(:store) do |io, context|
          versions = { original: io } # retain original
  
          io.download do |original|
              pipeline = ImageProcessing::MiniMagick.source(original)
  
              versions[:editable]  = pipeline.resize_to_fit!(700, 700)
              versions[:thumbnail] = pipeline.resize_to_fill!(400, 400)
              versions[:small]  = pipeline.resize_to_fill!(200, 200)
          end
  
          versions # return the hash of processed files
      end
  
  end
  </code></pre>
  
  <p>my model : </p>
  
  <pre><code>class Profilepic &lt; ApplicationRecord
    require "image_processing/mini_magick"
    belongs_to :professionnel
    before_create :set_hashid
  
    include ProfilepicUploader::Attachment.new(:image) # adds an `image` virtual attribute
    include ProfilepicFinalUploader::Attachment.new(:final_image) # adds an `image` virtual attribute
  
  
   attr_accessor :crop_x, :crop_y, :crop_w, :crop_h   
  
   after_create  :save_ratio_image   
  
  private
  
    def save_ratio
      self.ratio = self.image[:original].width.to_i / self.image[:original].height.to_i
    end
  
  end
  </code></pre>