public function runTinyPng($file)
{
try {
\Tinify\setKey($this->getSetting('tinyPngApiKey'));
\Tinify\validate();
\Tinify\fromFile($file)->toFile($file);
} catch (\Tinify\Exception $e) {
ImagerPlugin::log("Could not validate connection to TinyPNG, image was not optimized.", LogLevel::Error);
}
}