[images] Use proper mime-type for displayable images.
This commit is contained in:
parent
49946e684b
commit
178a0ffb4d
1
CHANGES
1
CHANGES
|
@ -8,6 +8,7 @@ For further information about Photo Organizer, see its web site at:
|
|||
|
||||
???? (Unreleased)
|
||||
|
||||
[fix] Mime type not set properly for images.
|
||||
[fix] Spool controls not working on an empty folder.
|
||||
[fix] URLs in the RSS feed were broken with pretty URLs enabled.
|
||||
|
||||
|
|
|
@ -187,8 +187,12 @@ switch ($photo_data['access_rights']) {
|
|||
# Another fixup.
|
||||
if($image_type == 'jpg') $image_type = 'jpeg';
|
||||
|
||||
if(($image_type != 'jpeg') && ($image_type != 'png'))
|
||||
if(($image_type != 'jpeg') && ($image_type != 'png')) {
|
||||
$disposition = "attachment"; // can't display non-jpg/png in browser.
|
||||
$mime_type = "application/octet-stream";
|
||||
} else {
|
||||
$mime_type = "image/$image_type";
|
||||
}
|
||||
|
||||
header("Content-Disposition: $disposition; filename=$original_image_name; modification-date=\"$rfc1123\"; size=$file_length");
|
||||
header("Last-Modified: $rfc1123");
|
||||
|
@ -196,6 +200,7 @@ header("Last-Modified: $rfc1123");
|
|||
/* Add an expires: header */
|
||||
$expires = gmdate("r", (time() + 604800)) .' GMT'; /* 1 week */
|
||||
|
||||
header("Content-Type: $mime_type");
|
||||
header("Expires: $expires");
|
||||
|
||||
if ($cache_ctrl != FALSE) {
|
||||
|
|
Loading…
Reference in New Issue