title: How do I resize image using intervention before storing to s3?
body: <p>I'm saving the image to s3 and the s3 path to my database.  I'm calling the path when I need to show the image. So right now I'm having trouble resizing that image before saving it to s3.  I get this error message:</p>
  
  <pre><code>Command (getRealPath) is not available for driver (Gd).
  </code></pre>
  
  <p>this is what my controller looks like </p>
  
  <pre><code>public function up(Request $request) {
  
          $user = $request-&gt;user();
          $image= $request-&gt;file('images');
  
            if(!empty(($image))){
             $files = Input::file('images');
             foreach($files as $file) {
              if(!empty($file)){
  
  
  
              $ext = $file-&gt;getClientOriginalExtension();
  
              $media = ($user-&gt;media-&gt;where('category','profile')-&gt;first());
              if($media == null){
                  $media = new Media();
                  $media-&gt;category='profile';
              }       
                  $this-&gt;saveMedia($media, $user,$file);
              }
          }
              return Redirect::back()-&gt;with('message','Your profile has been updated');
          }
      }
      private function saveMedia($media, $user, $file){
  
          $ext = $file-&gt;getClientOriginalExtension();
          $key = strtotime('now') . '.' . $ext;        
          $id = $user-&gt;id;
          $url = 'https://s3-us-west-2.amazonaws.com/makersbrand/' . $id . '/' . $media-&gt;category . '/';
          $media-&gt;user_id = $user-&gt;id;
          $media-&gt;path = $url . $key;
  
          $this-&gt;fillMedia($media,$user,$file, $key);
          $media-&gt;save();
  
      }
      private function fillMedia($media, $user, $file, $key)
      {
          $file = Image::make($file)-&gt;resize(200,200);
          $s3 = AWS::createClient('s3');
          $result = $s3-&gt;putObject(array(
              'Bucket' =&gt; self::$_BUCKET_NAME,
              'Key' =&gt; $user-&gt;id . '/'. $media-&gt;category .'/'. $key,
              'SourceFile' =&gt; $file-&gt;getRealPath(),
              'Metadata' =&gt; array(
              'Owner' =&gt; $user-&gt;first_name .' ' . $user-&gt;last_name
              )
              ));
      }
  </code></pre>
  
  <p><strong>Update</strong>
  I don't think my images even get resized properly before it hits the getClientOriginalExtension error.  When I do var_dump after resizing, I get this text:</p>
  
  <pre><code>object(Intervention\Image\Image)#238 (9) { ["driver":protected]=&gt; 
  object(Intervention\Image\Gd\Driver)#237 (2) { ["decoder"]=&gt; 
  object(Intervention\Image\Gd\Decoder)#241 (1) { 
  ["data":"Intervention\Image\AbstractDecoder":private]=&gt; NULL } 
  ["encoder"]=&gt; object(Intervention\Image\Gd\Encoder)#242 (4) { ["result"]=&gt; 
  NULL ["image"]=&gt; NULL ["format"]=&gt; NULL ["quality"]=&gt; NULL } } 
  ["core":protected]=&gt; resource(280) of type (gd) ["backups":protected]=&gt; 
  array(0) { } ["encoded"]=&gt; string(0) "" ["mime"]=&gt; string(10) "image/jpeg" 
  ["dirname"]=&gt; string(26) "/Applications/MAMP/tmp/php" ["basename"]=&gt; 
  string(9) "phpVGzVk0" ["extension"]=&gt; NULL ["filename"]=&gt; string(9)
   "phpVGzVk0" }
  </code></pre>
  
  <p>Result is null.  Format is null. image is Null.  What am I doing wrong here?</p>
  
  <p><strong>update</strong>
  I moved Image::make to my saveMedia function.  Now I get </p>
  
  <pre><code>Command (getRealPath) is not available for driver (Gd).
  </code></pre>