public function fromResource($fp)
    {
        $tmpfile = tempnam(sys_get_temp_dir(), 'ucr');
        $temp = fopen($tmpfile, 'w');
        while (!feof($fp)) {
            fwrite($temp, fread($fp, 8192));
        }
        fclose($temp);
        fclose($fp);

        return $this->fromPath($tmpfile);
    }