title: How to resize images before uploading with Active Storage (linked with AWS)
body: <p>I try to use Active Storage with Amazon Web Services, instead of Carrierwave and Cloudinary.</p>
  
  <p>With Carrierwave I had some features that allow to resize images before uploading trough an UploaderController.</p>
  
  <p>But how to do that with Active Storage ?</p>
  
  <p>I try this :</p>
  
  <p>Gemfile :</p>
  
  <pre><code>gem 'aws-sdk-s3', require: false
  gem 'image_processing', '~&gt; 1.2'
  gem 'mini_magick', '~&gt;4.9'
  </code></pre>
  
  <p>item.rb</p>
  
  <pre><code>class Item &lt; ApplicationRecord
      has_one_attached :photo
  end
  </code></pre>
  
  <p>I have a form in my view :</p>
  
  <pre><code>&lt;%= f.input :photo, input_html: { accept: ('image') } %&gt;
  </code></pre>
  
  <p>I get this object as photo :</p>
  
  <pre><code>#&lt;ActiveStorage::Attached::One:0x00005641d296e1b8 @name="photo", @record=#&lt;Item id: nil, name: "test0941", verbe: "To Lend", collection_id: nil, created_at: nil, updated_at: nil, price_cents: 0, description: "", category_id: 78, photo: nil&gt;, @dependent=:purge_later&gt;
  </code></pre>
  
  <p>And in my controller :</p>
  
  <pre><code>@item = Item.new(item_params)
  @item.photo.combine_options do |b|
      b.resize "250x200&gt;"
  end
  </code></pre>
  
  <p>I can't achieve to resize my photo with methods of MiniMagick gem.</p>
  
  <p>Does anybody have any ideas to do that ?</p>
  
  <p>Thanks for your help,
  Thibault</p>