public function getFromURL($url, $name = false)
    {
        $tmp_path = sys_get_temp_dir() . '/';

        if (Validator::validate(Validator::V_LINK, $url)) {
            $image = getimagesize($url);
            switch ($image['mime']) {
                case 'image/gif':
                case 'image/png':
                case 'image/bmp':
                case 'image/jpeg':
                    if ($image['mime'] == 'image/gif') {
                        $type = '.gif';
                    }
                    if ($image['mime'] == 'image/png') {
                        $type = '.png';
                    }
                    if ($image['mime'] == 'image/bmp') {
                        $type = '.bmp';
                    }
                    if ($image['mime'] == 'image/jpeg') {
                        $type = '.jpg';
                    }

                    if (!$name) {
                        $name = uniqid('post-') . $type;
                    } else {
                        $name .= '-' . uniqid("", true) . $type;
                    }
                    file_put_contents($tmp_path . $name, file_get_contents($url));

                    $this->getFromPath($name, sys_get_temp_dir());
                    $this->width  = $image[0];
                    $this->height = $image[1];

                    return true;
                default:
                    return false;
            }
        }

        return false;
    }