[Mapbender-commits] r8135 - branches/2.7/http/print/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Sep 12 05:05:17 EDT 2011


Author: kmq
Date: 2011-09-12 02:05:17 -0700 (Mon, 12 Sep 2011)
New Revision: 8135

Modified:
   branches/2.7/http/print/classes/mbPermanentImgDecorator.php
Log:
small fixup concerning image size calculations

Modified: branches/2.7/http/print/classes/mbPermanentImgDecorator.php
===================================================================
--- branches/2.7/http/print/classes/mbPermanentImgDecorator.php	2011-09-12 08:59:01 UTC (rev 8134)
+++ branches/2.7/http/print/classes/mbPermanentImgDecorator.php	2011-09-12 09:05:17 UTC (rev 8135)
@@ -34,8 +34,8 @@
 
         $markers = json_decode($permanentImage);
 
-        //only works if dpi is set to 72
-        $_REQUEST['dpi'] = 72;
+        // If images are printed use the $_REQUEST['dpi'] setting they get too small at hight dpi values
+        $imagedpi = 72;
 
         foreach( $markers as $marker){
 
@@ -65,13 +65,13 @@
 
 
             // add the marker offset to the left 
-            $pdf_marker_off_x = ($marker->offset_x * 25.4)/$_REQUEST['dpi']; //unit: mm
+            $pdf_marker_off_x = ($marker->offset_x * 25.4)/$imagedpi; //unit: mm
             
             // left edge of the image on the pdf
             $pdf_img_off_x = ($pdf_map_x1 +  $img_off_x * ($pdf_map_dx/$map_dx)) - $pdf_marker_off_x ;  //unit: mm
 
             // width of the image on the pdf
-            $pdf_img_dx = ($marker->width * 25.4)/$_REQUEST['dpi']; //unit: mm
+            $pdf_img_dx = ($marker->width * 25.4)/$imagedpi; //unit: mm
             
 
             // top edge of the map on pdf 
@@ -98,13 +98,13 @@
 
 
             // add the marker offset to the top 
-            $pdf_marker_off_y = ($marker->offset_y * 25.4)/$_REQUEST['dpi']; //unit: mm
+            $pdf_marker_off_y = ($marker->offset_y * 25.4)/$imagedpi; //unit: mm
             
             // top edge of the image on the pdf
             $pdf_img_off_y = $pdf_map_dy - ($pdf_map_y1 +  $img_off_y * ($pdf_map_dy/$map_dy)) + $pdf_marker_off_y;  //unit: mm
 
             // width of the image on the pdf
-            $pdf_img_dy = ($marker->width * 25.4)/$_REQUEST['dpi']; //unit: mm
+            $pdf_img_dy = ($marker->width * 25.4)/$imagedpi; //unit: mm
 
             
             $left = $pdf_img_off_x;



More information about the Mapbender_commits mailing list