Exemplo n.º 1
0
 public function save($filename = null, $permissions = null)
 {
     extract(parent::save($filename, $permissions));
     $this->run_queue();
     $this->add_background();
     $filetype = $this->image_extension;
     $old = '"' . $this->image_temp . '"';
     $new = '"' . $filename . '"';
     if (($filetype == 'jpeg' or $filetype == 'jpg') and $this->config['quality'] != 100) {
         $quality = '"' . $this->config['quality'] . '%"';
         $this->exec('convert', $old . ' -quality ' . $quality . ' ' . $new);
     } else {
         $this->exec('convert', $old . ' ' . $new);
     }
     if ($this->config['persistence'] === false) {
         $this->reload();
     }
     return $this;
 }
Exemplo n.º 2
0
 public function save($filename = null, $permissions = null)
 {
     extract(parent::save($filename, $permissions));
     $this->run_queue();
     $this->add_background();
     $filetype = $this->image_extension;
     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();
     }
     file_put_contents($filename, $this->imagick->getImageBlob());
     if ($this->config['persistence'] === false) {
         $this->reload();
     }
     return $this;
 }
Exemplo n.º 3
0
 public function save($filename = null, $permissions = null)
 {
     extract(parent::save($filename, $permissions));
     $this->run_queue();
     $this->add_background();
     $vars = array(&$this->image_data, $filename);
     $filetype = $this->image_extension;
     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;
 }