You are here

public function TinyPng::setFromUrl in TinyPNG 8

Compress with \Tinify\fromUrl.

Parameters

string $url: URI of image file.

Return value

$this Current instance.

Overrides TinyPngInterface::setFromUrl

File

src/TinyPng.php, line 102

Class

TinyPng
Class TinyPng.

Namespace

Drupal\tinypng

Code

public function setFromUrl($url) {
  $this
    ->setApiKey();
  $origin = file_create_url($url);
  $this->tinyfySource = TinifyFromUrl($origin);
  return $this;
}