[mapserver-commits] r7925 - in branches/branch-5-2/mapserver: . mapscript/php3

svn at osgeo.org svn at osgeo.org
Tue Sep 23 17:20:08 EDT 2008


Author: Assefa
Date: 2008-09-23 17:20:08 -0400 (Tue, 23 Sep 2008)
New Revision: 7925

Modified:
   branches/branch-5-2/mapserver/HISTORY.TXT
   branches/branch-5-2/mapserver/mapscript/php3/php_mapscript.c
Log:
PHP paste image should also work with AGG (#2682)

Modified: branches/branch-5-2/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-2/mapserver/HISTORY.TXT	2008-09-23 21:14:56 UTC (rev 7924)
+++ branches/branch-5-2/mapserver/HISTORY.TXT	2008-09-23 21:20:08 UTC (rev 7925)
@@ -13,6 +13,8 @@
 Current Version (SVN branch-5-2)
 --------------------------------
 
+- PHP paste image should also work with AGG (#2682)
+
 - Correct allocation error in mapmssql2008.c (#2768)
 
 - Removed comma to correct WCS 1.1 Coverages formatting in payload directory. 

Modified: branches/branch-5-2/mapserver/mapscript/php3/php_mapscript.c
===================================================================
--- branches/branch-5-2/mapserver/mapscript/php3/php_mapscript.c	2008-09-23 21:14:56 UTC (rev 7924)
+++ branches/branch-5-2/mapserver/mapscript/php3/php_mapscript.c	2008-09-23 21:20:08 UTC (rev 7925)
@@ -6350,11 +6350,19 @@
     imgSrc = (imageObj *)_phpms_fetch_handle(pSrcImg, PHPMS_GLOBAL(le_msimg), 
                                              list TSRMLS_CC);
     
-    if( !MS_DRIVER_GD(imgSrc->format) || !MS_DRIVER_GD(imgDst->format))
+    if( (!MS_DRIVER_GD(imgSrc->format) && !MS_DRIVER_AGG(imgSrc->format)) ||  
+ 	(!MS_DRIVER_GD(imgDst->format) && !MS_DRIVER_AGG(imgDst->format))) 
     {
-        php3_error(E_ERROR, "PasteImage function should only be used with GD images.");
+        php3_error(E_ERROR, "PasteImage function should only be used with GD or AGG images.");
         RETURN_LONG(-1);
     }
+
+#ifdef USE_AGG
+    if( MS_RENDERER_AGG(imgSrc->format)) 
+      msAlphaAGG2GD(imgSrc); 
+    if( MS_RENDERER_AGG(imgDst->format)) 
+      msAlphaAGG2GD(imgDst); 
+#endif
       
     convert_to_long(pTransparent);
 



More information about the mapserver-commits mailing list