Qiniu_ImageView::MakeRequest PHP Méthode

MakeRequest() public méthode

public MakeRequest ( $url )
    public function MakeRequest($url)
    {
        $ops = array($this->Mode);
        if (!empty($this->Width)) {
            $ops[] = 'w/' . $this->Width;
        }
        if (!empty($this->Height)) {
            $ops[] = 'h/' . $this->Height;
        }
        if (!empty($this->Quality)) {
            $ops[] = 'q/' . $this->Quality;
        }
        if (!empty($this->Format)) {
            $ops[] = 'format/' . $this->Format;
        }
        return $url . "?imageView/" . implode('/', $ops);
    }

Usage Example

Exemple #1
0
 public function testImageView()
 {
     $imageView = new Qiniu_ImageView();
     $imageView->Mode = 1;
     $imageView->Width = 80;
     $imageView->Format = 'jpg';
     $url = $this->url;
     $expectedUrl = $url . '?imageView/1/w/80/format/jpg';
     $this->assertEquals($imageView->MakeRequest($url), $expectedUrl);
 }
All Usage Examples Of Qiniu_ImageView::MakeRequest
Qiniu_ImageView