public function load($filename, $return_data = false, $force_extension = false) { extract(parent::load($filename, $return_data, $force_extension)); if ($this->imagick == null) { $this->imagick = new Fuel_Imagick(); } $this->imagick->readImage($filename); return $this; }
public function load($filename, $return_data = false, $force_extension = false) { extract(parent::load($filename, $return_data, $force_extension)); $this->clear_sizes(); if (empty($this->image_temp)) { do { $this->image_temp = $this->config['temp_dir'] . substr($this->config['temp_applicationend'] . md5(time() * microtime()), 0, 32) . '.png'; } while (file_exists($this->image_temp)); } elseif (file_exists($this->image_temp)) { $this->debug('Removing previous temporary image.'); unlink($this->image_temp); } $this->debug('Temp file: ' . $this->image_temp); if (!file_exists($this->config['temp_dir']) || !is_dir($this->config['temp_dir'])) { throw new RuntimeException("The temp directory that was given does not exist."); } elseif (!touch($this->config['temp_dir'] . $this->config['temp_applicationend'] . '_touch')) { throw new RuntimeException("Could not write in the temp directory."); } $this->exec('convert', '"' . $image_fullpath . '"[0] "' . $this->image_temp . '"'); return $this; }