public function output($filetype = null) { $this->gdresizefunc = $filetype == 'gif' ? 'imagecopyresized' : ($this->gdresizefunc = 'imagecopyresampled'); extract(parent::output($filetype)); $this->run_queue(); $this->add_background(); $vars = array($this->image_data, null); if ($filetype == 'jpg' || $filetype == 'jpeg') { $vars[] = $this->config['quality']; $filetype = 'jpeg'; } elseif ($filetype == 'png') { $vars[] = floor($this->config['quality'] / 100 * 9); } call_user_func_array('image' . $filetype, $vars); if ($this->config['persistence'] === false) { $this->reload(); } return $this; }
public function output($filetype = null) { extract(parent::output($filetype)); $this->run_queue(); $this->add_background(); $image = '"' . $this->image_temp . '"'; if (($filetype == 'jpeg' or $filetype == 'jpg') and $this->config['quality'] != 100) { $quality = '"' . $this->config['quality'] . '%"'; $this->exec('convert', $image . ' -quality ' . $quality . ' ' . strtolower($filetype) . ':-', true); } elseif (substr($this->image_temp, -1 * strlen($filetype)) != $filetype) { if (!$this->config['debug']) { $this->exec('convert', $image . ' ' . strtolower($filetype) . ':-', true); } } else { if (!$this->config['debug']) { echo file_get_contents($this->image_temp); } } if ($this->config['persistence'] === false) { $this->reload(); } return $this; }
public function output($filetype = null) { extract(parent::output($filetype)); $this->run_queue(); $this->add_background(); if (substr($this->image_temp, -1 * strlen($filetype)) != $filetype) { $old = '"' . $this->image_temp . '"'; if (!$this->config['debug']) { $this->exec('convert', $old . ' ' . strtolower($filetype) . ':-', true); } } else { if (!$this->config['debug']) { echo file_get_contents($this->image_temp); } } if ($this->config['persistence'] === false) { $this->reload(); } return $this; }
public function output($filetype = null) { extract(parent::output($filetype)); $this->run_queue(); $this->add_background(); if ($filetype == 'jpg' or $filetype == 'jpeg') { $filetype = 'jpeg'; } if ($this->imagick->getImageFormat() != $filetype) { $this->imagick->setImageFormat($filetype); } if ($this->imagick->getImageFormat() == 'jpeg' and $this->config['quality'] != 100) { $this->imagick->setImageCompression(\Imagick::COMPRESSION_JPEG); $this->imagick->setImageCompressionQuality($this->config['quality']); $this->imagick->stripImage(); } if (!$this->config['debug']) { echo $this->imagick->getImageBlob(); } return $this; }
public function output($filetype = null) { extract(parent::output($filetype)); $this->run_queue(); $this->add_background(); if ($this->imagick->getImageFormat() != $filetype) { $this->imagick->setImageFormat($filetype); } if (!$this->config['debug']) { echo $this->imagick->getImageBlob(); } return $this; }