title: Getting Error: NotReadableException in AbstractDecoder.php line 302
body: <p>I am following a turtorial on how to save photos and resize them as thumbnails using PHP, Laravel 5.1, MySQL, InterventionImage plugin, and am getting the following error when I try to add photos:</p>
  
  <p>NotReadableException in AbstractDecoder.php line 302: Image source not readable</p>
  
  <p>It seems that the problem is happening in the Photo code below in the <strong>makeThumbnail</strong> method. The original photo is stored in my flyers/photo folder, but the thumbnail file is never created and the photo is not stored in the database. I have followed all the steps and checked the routes, models, views controllers but everything seems to be identical to the tutorial so I am not sure what I am doing wrong.The error stops showing up if I dd() this function, but I have failed at fixing it after many attempts. The </p>
  
  <p>Photo eloquent model:</p>
  
  <pre><code>&lt;?php
  namespace App;
  
  use Intervention\Image\Facades\Image;
  use Illuminate\Database\Eloquent\Model;
  use Symfony\Component\HttpFoundation\File\UploadedFile;
  
  class Photo extends Model
  {
  protected $table = 'flyer_photos';
  protected $fillable = ['path' , 'name' , 'thumbnail_path'];
  protected $baseDir = 'flyer/photos';
  
  public function flyer(){
      // creates a new instance of a photo
      return $this-&gt;belongsTo('App\Flyer');
  }
  
  /**
   * Build a photo instance from a file upload
   */
  public static function named($name){
  
  
      return (new static)-&gt;saveAs($name);
  
  }
  
  /**
   * Setting name, path, and thumbnail_path parameters for Photo instance
   */
  protected function saveAs($name){
      //concatenate file name with current time to prevent duplicate entries in db
      $this-&gt;name = sprintf("%s-%s", time(), $name);
      $this-&gt;path = sprintf("%/%s", $this-&gt;baseDir, $this-&gt;name);
      $this-&gt;thumbnail_path =sprintf("%s/tn-%s", $this-&gt;baseDir, $this-&gt;name);
  
      return $this;
  
  }
  
  public function move(UploadedFile $file){
  
      // move the file to new location in flyer/photos
      $file-&gt;move($this-&gt;baseDir, $this-&gt;name);
  
      $this-&gt;makeThumbnail();
  
      return $this;
  }
  
  /**
   * Change sizing of thumbnail and save it
   */
  protected function makeThumbnail() {
      //dd('error test');
      Image::make($this-&gt;path)
      -&gt;fit(200)
      -&gt;save($this-&gt;thumbnail_path);
  }
  </code></pre>
  
  <p>Controller code:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  use App\Flyer;
  use Illuminate\Http\Request;
  use App\Http\Requests\FlyerRequest;
  use App\Http\Controllers\Controller;
  use App\Http;
  use App\Photo;
  use Symfony\Component\HttpFoundation\File\UploadedFile;
  
  
  class FlyersController extends Controller
  {
  
  /**
   * Auth checks to make sure you are logged in before making any adjustments
   */
  public function __construct()
  {
      $this-&gt;middleware('auth', ['except' =&gt; ['show']]);
  }
  
  /**
   * Display a listing of the resource.
   */
  public function index()
  {
      //
  }
  
  /**
   * Show the form for creating a new resource.
   */
  public function create()
  {
      flash()-&gt;overlay('Hello World', 'this is the message');
  
      return view('flyers.create');
  }
  
  /**
   * Store a newly created resource in storage.
   */
  public function store(FlyerRequest $request)
  {
  
      //persist the flyer
      Flyer::create($request-&gt;all());
  
      //flash messaging
      flash()-&gt;success('Success!', 'Your flyer has been created.');
  
      return view('pages.home');//temporary redirect the landing page
  
  }
  
  /**
   * Display the specified resource.
   */
  public function show($zip, $street)
  {
      //find the new flyer
      $flyer = Flyer::locatedAt($zip, $street);
  
      return view('flyers.show', compact('flyer'));
  
  }
  
  /**
   * Apply photo to the referenced flyer.
   */
  public function addPhoto($zip, $street, Request $request){
  
      //confirmtion that the photo file will be in appropriate format types
      $this-&gt;validate($request, [
          'photo' =&gt; 'required|mimes:jpg,jpeg,png,bmp'
      ]);
  
      //build up our photo instance taking the file from dropzone plugin
      $photo = $this-&gt;makePhoto($request-&gt;file('photo'));
  
      //Save photo and associate it with the Flyer
      Flyer::locatedAt($zip, $street)-&gt;addPhoto($photo);
  }
  
  protected function makePhoto(UploadedFile $file){
  
      //get new photo object with current name
      return Photo::named($file-&gt;getClientOriginalName())-&gt;move($file);
  }
  }
  </code></pre>