protected function processTempImage($tmp, $options, $oldFile = '') { $tmp = str_replace('/', DIRECTORY_SEPARATOR, $tmp); try { $options = array_merge(array('onlyCreateWhenNew' => false, 'overwrite' => false), $options); /** delete previous images */ if (!empty($oldFile) && file_exists($oldFile)) { unlink($oldFile); } $path = ImageProcessor::resize($tmp, $options); } catch (\Exception $e) { $this->app->getLogger()->log("error with message " . $e->getMessage()); throw new \Exception($e->getMessage()); } $path = str_replace(array($this->app->getTheme()->getPublicBasePath(), DIRECTORY_SEPARATOR), array('', '/'), $path); return $path; }
public function testIsWindows() { $this->assertEquals(true, true); echo "If your OS is Windows, the following should return True: \n"; echo ImageProcessor::isWindows(); }