title: Laravel 5.4 GIF Images are saved "statically"
body: <p>I am working on this <a href="https://codecanyon.net/item/socialite-laravel-social-network-script/" rel="nofollow noreferrer">Laravel 5.4 Social Network Script</a> and when I post something the avatar is being displayed "animated" but when it is being saved it is converted to an static image.</p>
  
  <p>I have this in the controller TimelineController@createPost:</p>
  
  <pre><code>...
  use App\Media;
  use App\Post;
  use Intervention\Image\Facades\Image;
  ...
  public function createPost(Request $request)
  {
      $input = $request-&gt;all();
  
      $post = Post::create($input);
      ...
      if ($request-&gt;file('post_images_upload_modified')) {
          foreach ($request-&gt;file('post_images_upload_modified') as $postImage) {
              $strippedName = str_replace(' ', '', $postImage-&gt;getClientOriginalName());
              $photoName = date('Y-m-d-H-i-s').$strippedName;
  
              $avatar = Image::make($postImage-&gt;getRealPath());
              $avatar-&gt;save(storage_path().'/uploads/users/gallery/'.$photoName, 60);
  
              $media = Media::create([
                    'title'  =&gt; $photoName,
                    'type'   =&gt; 'image',
                    'source' =&gt; $photoName,
                  ]);
  
              $post-&gt;images()-&gt;attach($media);
          }
      }
      ...
  }
  ...
  </code></pre>
  
  <p>It uses <a href="http://php.net/manual/en/book.image.php" rel="nofollow noreferrer">GD Library</a> to process the images internally.</p>
  
  <p>The file Image.php on <a href="https://github.com/Intervention/image" rel="nofollow noreferrer">/vendor/intervention/image/src/Intervention/Image/</a>:</p>
  
  <blockquote>
    <ul>
    <li>@method \Intervention\Image\Image make(mixed $source)                                                                                                                  Universal factory method to create a new image instance from source, which can be a filepath, a GD image resource, an Imagick object or a binary image data.</li>
    </ul>
  </blockquote>
  
  <pre><code>/**
   * Starts encoding of current image
   *
   * @param  string  $format
   * @param  integer $quality
   * @return \Intervention\Image\Image
   */
  public function encode($format = null, $quality = 90)
  {
      return $this-&gt;driver-&gt;encode($this, $format, $quality);
  }
  
  /**
   * Saves encoded image in filesystem
   *
   * @param  string  $path
   * @param  integer $quality
   * @return \Intervention\Image\Image
   */
  public function save($path = null, $quality = null)
  {
      $path = is_null($path) ? $this-&gt;basePath() : $path;
  
      if (is_null($path)) {
          throw new Exception\NotWritableException(
              "Can't write to undefined path."
          );
      }
  
      $data = $this-&gt;encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
      $saved = @file_put_contents($path, $data);
  
      if ($saved === false) {
          throw new Exception\NotWritableException(
              "Can't write image data to path ({$path})"
          );
      }
  
      // set new file info
      $this-&gt;setFileInfoFromPath($path);
  
      return $this;
  }
  </code></pre>
  
  <p>The stored image is a GIF but resized despite it is not specified:</p>
  
  <p><a href="https://i.stack.imgur.com/pe6Vd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pe6Vd.png" alt="enter image description here"></a></p>
  
  <p>Do you know how to make the image animated when saved? </p>