resizing now uses right file type
This commit is contained in:
parent
5e2248cd04
commit
5be211b209
@ -159,11 +159,6 @@ class http2pic
|
|||||||
//add storage path to cmd
|
//add storage path to cmd
|
||||||
$cmd.=' '.escapeshellarg($this->params['file']);
|
$cmd.=' '.escapeshellarg($this->params['file']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//.$this->params['vp'].$this->params['jsp'].'-f '.$this->params['fileType'].' '.$this->params['url'].' '.$this->params['file'];
|
|
||||||
|
|
||||||
$cmd = escapeshellcmd($cmd);
|
$cmd = escapeshellcmd($cmd);
|
||||||
shell_exec($cmd);
|
shell_exec($cmd);
|
||||||
$this->params['cmd'] = $cmd;
|
$this->params['cmd'] = $cmd;
|
||||||
@ -214,9 +209,16 @@ class http2pic
|
|||||||
|
|
||||||
// resample
|
// resample
|
||||||
$image_p = imagecreatetruecolor($this->params['resizewidth'], $height);
|
$image_p = imagecreatetruecolor($this->params['resizewidth'], $height);
|
||||||
$image = imagecreatefromjpeg($file);
|
if ($this->params['type'] === 'png')
|
||||||
|
$image = imagecreatefrompng($file);
|
||||||
|
else
|
||||||
|
$image = imagecreatefromjpeg($file);
|
||||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $this->params['resizewidth'], $height, $width_orig, $height_orig);
|
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $this->params['resizewidth'], $height, $width_orig, $height_orig);
|
||||||
imagejpeg($image_p, $file, 100);
|
|
||||||
|
if ($this->params['type'] === 'png')
|
||||||
|
imagepng($image_p, $file, 9);
|
||||||
|
else
|
||||||
|
imagejpeg($image_p, $file, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user