Merge pull request #10 from chpwssn/master
Add Content-Disposition to make saving images cleaner
This commit is contained in:
commit
77f2a2651c
@ -231,11 +231,13 @@ class http2pic
|
|||||||
if ($this->params['type'] === 'png') {
|
if ($this->params['type'] === 'png') {
|
||||||
|
|
||||||
header('Content-Type: image/png');
|
header('Content-Type: image/png');
|
||||||
|
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'.png"');
|
||||||
$result = imagecreatefrompng($this->params['file']);
|
$result = imagecreatefrompng($this->params['file']);
|
||||||
imagepng($result, NULL, 9);
|
imagepng($result, NULL, 9);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header('Content-Type: image/jpeg');
|
header('Content-Type: image/jpeg');
|
||||||
|
header('Content-Disposition: inline; filename="'.$this->trimToAlphaNumeric($this->params['url']).'.jpg"');
|
||||||
$result = imagecreatefromjpeg($this->params['file']);
|
$result = imagecreatefromjpeg($this->params['file']);
|
||||||
imagejpeg($result, NULL, 100);
|
imagejpeg($result, NULL, 100);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user