1
0
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:
Mikael Roos
2015-10-18 18:34:42 +02:00
parent 9e2bd27c6e
commit 553d2f3db1
2 changed files with 12 additions and 7 deletions

View File

@@ -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);
} }

View 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.