[Mapbender-commits] r10083 - in trunk/mapbender: http_auth/http owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Mar 21 02:57:39 PDT 2019
Author: armin11
Date: 2019-03-21 02:57:39 -0700 (Thu, 21 Mar 2019)
New Revision: 10083
Modified:
trunk/mapbender/http_auth/http/index.php
trunk/mapbender/owsproxy/http/index.php
Log:
rewind fix
Modified: trunk/mapbender/http_auth/http/index.php
===================================================================
--- trunk/mapbender/http_auth/http/index.php 2019-03-20 14:46:04 UTC (rev 10082)
+++ trunk/mapbender/http_auth/http/index.php 2019-03-21 09:57:39 UTC (rev 10083)
@@ -644,33 +644,26 @@
function responseImage($im)
{
global $reqParams;
- global $imageformats;
- if (!in_array($reqParams['format'], $imageformats)) {
+ $format = $reqParams['format'];
+ $format = "image/gif";
+ if ($format == 'image/png') {
header("Content-Type: image/png");
+ }
+ if ($format == 'image/jpeg' || $format == 'image/jpg') {
+ header("Content-Type: image/jpeg");
+ }
+ if ($format == 'image/gif') {
+ header("Content-Type: image/gif");
+ }
+ if ($format == 'image/png') {
imagepng($im);
- } else {
- $format = $reqParams['format'];
- //$format = "image/gif";
- if ($format == 'image/png') {
- header("Content-Type: image/png");
- }
- if ($format == 'image/jpeg' || $format == 'image/jpg') {
- header("Content-Type: image/jpeg");
- }
- if ($format == 'image/gif') {
- header("Content-Type: image/gif");
- }
-
- if ($format == 'image/png') {
- imagepng($im);
- }
- if ($format == 'image/jpeg' || $format == 'image/jpg') {
- imagejpeg($im);
- }
- if ($format == 'image/gif') {
- imagegif($im);
- }
}
+ if ($format == 'image/jpeg' || $format == 'image/jpg') {
+ imagejpeg($im);
+ }
+ if ($format == 'image/gif') {
+ imagegif($im);
+ }
}
function completeURL($url)
@@ -693,13 +686,8 @@
*/
function getImage($log_id, $or)
{
- global $reqParams;
- global $imageformats;
- if (!in_array($reqParams['format'], $imageformats)) {
- $header = "Content-Type: image/png";
- } else {
- $header = "Content-Type: ".$reqParams['format'];
- }
+ global $reqParams;
+ header("Content-Type: " . $reqParams['format']);
if (func_num_args() == 3) { //new for HTTP Authentication
$auth = func_get_arg(2);
//$e = new mb_exception("try to get: ". $or);
Modified: trunk/mapbender/owsproxy/http/index.php
===================================================================
--- trunk/mapbender/owsproxy/http/index.php 2019-03-20 14:46:04 UTC (rev 10082)
+++ trunk/mapbender/owsproxy/http/index.php 2019-03-21 09:57:39 UTC (rev 10083)
@@ -556,33 +556,27 @@
function responseImage($im)
{
global $reqParams;
- global $imageformats;
- if (!in_array($reqParams['format'], $imageformats)) {
+ $format = $reqParams['format'];
+ $format = "image/gif";
+ if ($format == 'image/png') {
header("Content-Type: image/png");
+ }
+ if ($format == 'image/jpeg' || $format == 'image/jpg') {
+ header("Content-Type: image/jpeg");
+ }
+ if ($format == 'image/gif') {
+ header("Content-Type: image/gif");
+ }
+
+ if ($format == 'image/png') {
imagepng($im);
- } else {
- $format = $reqParams['format'];
- //$format = "image/gif";
- if ($format == 'image/png') {
- header("Content-Type: image/png");
- }
- if ($format == 'image/jpeg' || $format == 'image/jpg') {
- header("Content-Type: image/jpeg");
- }
- if ($format == 'image/gif') {
- header("Content-Type: image/gif");
- }
-
- if ($format == 'image/png') {
- imagepng($im);
- }
- if ($format == 'image/jpeg' || $format == 'image/jpg') {
- imagejpeg($im);
- }
- if ($format == 'image/gif') {
- imagegif($im);
- }
}
+ if ($format == 'image/jpeg' || $format == 'image/jpg') {
+ imagejpeg($im);
+ }
+ if ($format == 'image/gif') {
+ imagegif($im);
+ }
}
function completeURL($url)
@@ -606,18 +600,13 @@
function getImage($log_id, $or)
{
global $reqParams;
- global $imageformats;
- if (!in_array($reqParams['format'], $imageformats)) {
- $header = "Content-Type: image/png";
- } else {
- $header = "Content-Type: ".$reqParams['format'];
- }
+ $header = "Content-Type: ".$reqParams['format'];
#log the image_requests to database
#log the following to table mb_proxy_log
#timestamp,user_id,getmaprequest,amount pixel,price - but do this only for wms to log - therefor first get log tag out of wms!
#
- #
- if (func_num_args() == 3) { //new for HTTP Authentication
+ #
+ if (func_num_args() == 3) { //new for HTTP Authentication
$auth = func_get_arg(2);
getDocumentContent($log_id, $or, $header, $auth);
} else {
More information about the Mapbender_commits
mailing list