public function load($filename, $return_data = false) { extract(parent::load($filename, $return_data)); $return = false; $image_extension == 'jpg' and $image_extension = 'jpeg'; if (!$return_data) { $this->image_data !== null and imagedestroy($this->image_data); $this->image_data = null; } // Check if the function exists if (function_exists('imagecreatefrom' . $image_extension)) { // Create a new transparent image. $sizes = $this->sizes($image_fullpath); $tmpImage = call_user_func('imagecreatefrom' . $image_extension, $image_fullpath); $image = $this->create_transparent_image($sizes->width, $sizes->height, $tmpImage); if (!$return_data) { $this->image_data = $image; $return = true; } else { $return = $image; } $this->debug('', "<strong>Loaded</strong> <code>" . $image_fullpath . "</code> with size of " . $sizes->width . "x" . $sizes->height); } else { throw new \RuntimeException("Function imagecreatefrom" . $image_extension . "() does not exist (Missing GD?)"); } return $return_data ? $return : $this; }
public function load($filename, $return_data = false) { extract(parent::load($filename)); $this->clear_sizes(); if (empty($this->image_temp)) { do { $this->image_temp = $this->config['temp_dir'] . substr($this->config['temp_append'] . md5(time() * microtime()), 0, 32) . '.png'; } while (file_exists($this->image_temp)); } else { if (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 \Fuel_Exception("The temp directory that was given does not exist."); } else { if (!touch($this->config['temp_dir'] . $this->config['temp_append'] . '_touch')) { throw new \Fuel_Exception("Could not write in the temp directory."); } } $this->exec('convert', '"' . $image_fullpath . '"[0] "' . $this->image_temp . '"'); return $this; }
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 \Imagick(); } $this->imagick->readImage($filename); return $this; }
public function load($filename) { extract(parent::load($filename)); if ($this->imagick == null) { $this->imagick = new \Imagick(); } $this->imagick->readImage($filename); return $this; }
public function load($filename) { extract(parent::load($filename)); $this->clear_sizes(); if (empty($this->image_temp)) { do { $this->image_temp = substr($this->config['temp_dir'] . $this->config['temp_append'] . md5(time() * microtime()), 0, 32) . '.png'; } while (file_exists($this->image_temp)); } $this->exec('convert', '"' . $image_fullpath . '" "' . $this->image_temp . '"'); return $this; }