title: getimagesize () Read Error
body: <p>I am using fuelphp framework. It uses getimagesize function (gd.php).
  Function get called 3-4 times while converting image to different sizes.  Some  times it work or after getting called 2-3 times it throws "Read Error".
  Site is hosted on Ubuntu machine with nginx server.
  Thanks.</p>
  
  <pre><code>public function sizes($filename = null)
  {
      if (empty($filename) &amp;&amp; !empty($this-&gt;image_fullpath))
      {
          $filename = $this-&gt;image_fullpath;
      }
  
      if ($filename == $this-&gt;image_fullpath &amp;&amp; is_resource($this-&gt;image_data))
      {
          $width  = imagesx($this-&gt;image_data);
          $height = imagesy($this-&gt;image_data);
      }
      else if (is_resource($filename))
      {
          $width  = imagesx($filename);
          $height = imagesy($filename);
      }
      else
      {
          list($width, $height) = getimagesize($filename);
      }
      return (object) array('width' =&gt; $width, 'height' =&gt; $height);
  }
  </code></pre>