mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-06 16:16:39 +02:00
Add header for Content-Length, #111.
This commit is contained in:
18
CImage.php
18
CImage.php
@@ -2366,8 +2366,16 @@ class CImage
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// Get details on image
|
||||||
|
$info = getimagesize($file);
|
||||||
|
!empty($info) or $this->raiseError("The file doesn't seem to be an image.");
|
||||||
|
$mime = $info['mime'];
|
||||||
|
$size = filesize($file);
|
||||||
|
|
||||||
if ($this->verbose) {
|
if ($this->verbose) {
|
||||||
$this->log("Last modified: " . $gmdate . " GMT");
|
$this->log("Last-Modified: " . $gmdate . " GMT");
|
||||||
|
$this->log("Content-type: " . $mime);
|
||||||
|
$this->log("Content-length: " . $size);
|
||||||
$this->verboseOutput();
|
$this->verboseOutput();
|
||||||
|
|
||||||
if (is_null($this->verboseFileName)) {
|
if (is_null($this->verboseFileName)) {
|
||||||
@@ -2375,12 +2383,8 @@ class CImage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get details on image
|
header("Content-type: $mime");
|
||||||
$info = getimagesize($file);
|
header("Content-length: $size");
|
||||||
!empty($info) or $this->raiseError("The file doesn't seem to be an image.");
|
|
||||||
$mime = $info['mime'];
|
|
||||||
|
|
||||||
header('Content-type: ' . $mime);
|
|
||||||
readfile($file);
|
readfile($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,7 @@ Revision history
|
|||||||
v0.7.6* (2015-10-18)
|
v0.7.6* (2015-10-18)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
* Add header for Content-Length, #111.
|
||||||
* Add check for postprocessing tools in path in `webroot/check_system.php`, #104.
|
* Add check for postprocessing tools in path in `webroot/check_system.php`, #104.
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user