title: Intervention \ Image \ Exception \ NotReadableException using laravel 4.2
body: <p>This bug on my code remotely is making me miserable, it works on my local app but it does not online, please take your time to experience it online <a href="http://popibay.com/petads/post/?cat=dog&amp;location=lagos&amp;lga=amuwo-odofin" rel="nofollow">http://popibay.com/petads/post/?cat=dog&amp;location=lagos&amp;lga=amuwo-odofin</a> debug it using a chrome inspector under network tab </p>
  
  <pre><code>  public function image(){
  
    $all_inputs = Input::all();
    $files = Input::file('file');
  
    $app_token = Input::get('_token');
    // setting up rules
  
      if (Input::hasFile('file')) {
  
       foreach ($files as $file) {
        $destinationPath = 'public/pb-uploads/pet_images/'; // upload path
        $thumbnail_path = 'public/pb-uploads/pet_images_thumbnail/';
        $popibay_watermark = 'public/pb-uploads/pet_images/popibay_white_logo_watermark/popibay_watermark_logo.png';
        $popibay_watermark_new = 'public/pb-uploads/pet_images/popibay_white_logo_watermark/popibay_watermark_opacity_logo.png';
        $extension = $file-&gt;getClientOriginalExtension(); // getting image extension
        $original_name = $file-&gt;getClientOriginalName();
        $random_number = rand(11111,99999);
        $fileName = $random_number.'.'.$extension; // renaming image
  
  
        // Image::make($file)-&gt;resize(600, 357)-&gt;insert($popibay_watermark_new,'center')-&gt;save($destinationPath.$fileName);
  
        Image::make($file)-&gt;insert($popibay_watermark_new,'center')-&gt;save($destinationPath.$fileName);
  
        Image::make($file)-&gt;resize(125, 155)-&gt;save($thumbnail_path.$fileName); // thumbnail image
  
        // $domain = 'http://popibay.com';
        $domain = 'http://' . $_SERVER["HTTP_HOST"];
        $destinationPath = '/pb-uploads/pet_images/'; // upload path
        $thumbnail_path = '/pb-uploads/pet_images_thumbnail/';
        $temp_id = rand(1,100);
  
        // save temp_id value to session...
  
        // $temp_saved_id = Petimage::where('temp_id','=',$temp_id)-&gt;first();
        // $temp_saved_id = $temp_saved_id-&gt;temp_id;
  
        $saved_temp_id = Session::get('saved_temp_id');
  
        if ( isset($saved_temp_id) ) {
  
          $pet_image = new Petimage;
          $pet_image-&gt;temp_id = $saved_temp_id;
          $pet_image-&gt;petad_id = 0;
          $pet_image-&gt;original_name = $original_name;
          $pet_image-&gt;image_path = $domain.$destinationPath.$fileName;
          $pet_image-&gt;image_thumbnail_path = $domain.$thumbnail_path.$fileName;
          $pet_image-&gt;image_name = $fileName;
          $pet_image-&gt;save();
  
          exit;
  
        }
  
        // Save to image table...
        $pet_image = new Petimage;
        $pet_image-&gt;temp_id = $temp_id;
        $pet_image-&gt;petad_id = 0;
        $pet_image-&gt;original_name = $original_name;
        $pet_image-&gt;image_path = $domain.$destinationPath.$fileName;
        $pet_image-&gt;image_thumbnail_path = $domain.$thumbnail_path.$fileName;
        $pet_image-&gt;image_name = $fileName;
        $pet_image-&gt;save();
  
        Session::put('saved_temp_id', $temp_id);
  
       }
  }
  </code></pre>
  
  <p>then this is the folder pb-uploads/ permissions. </p>
  
  <pre><code>pbadmin@popibayvm ~&gt; cd /var/www/html/popibay_azure/public/
  pbadmin@popibayvm /v/w/h/p/public&gt; ls -la
  drwxr-xr-x 5 pbadmin pbadmin  4096 Sep 13 13:45 ./
  drwxr-xr-x 6 pbadmin pbadmin  4096 Sep  8 22:11 ../
  drwxr-xr-x 3 pbadmin pbadmin  4096 Sep  8 22:41 packages/
  drwxr-xr-x 7 pbadmin pbadmin  4096 Sep  8 22:33 pb-assets/
  drwxrwxrwx 4 pbadmin pbadmin  4096 Oct 24 08:33 pb-uploads/
  </code></pre>