public function TinyPng::setFromFile in TinyPNG 8
Compress with \Tinify\fromFile.
Parameters
string $uri: URI of file.
Return value
$this Current instance.
Overrides TinyPngInterface::setFromFile
File
- src/
TinyPng.php, line 113
Class
- TinyPng
- Class TinyPng.
Namespace
Drupal\tinypngCode
public function setFromFile($uri) {
$this
->setApiKey();
$path = $this->fileSystem
->realpath($uri);
$this->tinyfySource = TinifyFromFile($path);
return $this;
}