[fusion-commits] r1533 - in trunk: templates/mapserver/standard/images utils

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Sep 16 13:39:56 EDT 2008


Author: pagameba
Date: 2008-09-16 13:39:56 -0400 (Tue, 16 Sep 2008)
New Revision: 1533

Modified:
   trunk/templates/mapserver/standard/images/icons.png
   trunk/utils/imagestrip.php
Log:
fix a bug in imagestrip that was causing transparency to be all black.

Modified: trunk/templates/mapserver/standard/images/icons.png
===================================================================
(Binary files differ)

Modified: trunk/utils/imagestrip.php
===================================================================
--- trunk/utils/imagestrip.php	2008-09-15 13:00:09 UTC (rev 1532)
+++ trunk/utils/imagestrip.php	2008-09-16 17:39:56 UTC (rev 1533)
@@ -13,7 +13,7 @@
 // defaults for command line arguments
 $depth = 8;
 $verbose = false;
-$overwrite = false;
+$append = false;
 $cssFile = 'imagestrip.css';
 $stripFile = 'imagestrip.png';
 $direction = 'horizontal';
@@ -28,8 +28,10 @@
         $depth = $argv[++$i];
     } else if ($arg == '-o') {
         $stripFile = $argv[++$i];
-    } else if ($arg == '-horizontal') {
+    } else if ($arg == '--horizontal') {
         $direction = 'horizontal';
+    } else if ($arg == '--append') {
+        $append = false;
     } else if ($arg == '-vertical') {
         $direction = 'vertical';
     } else if ($arg == '-v' || $arg == '--verbose') {
@@ -48,12 +50,12 @@
 
 // overwrite?
 if (file_exists($stripFile)) {
-    if ($overwrite) {
+    if (!$append) {
         unlink($stripFile);
     }
 }
 if (file_exists($cssFile)) {
-    if ($overwrite) {
+    if (!$append) {
         unlink($cssFile);
     }
 }
@@ -151,6 +153,9 @@
     $imgStrip = imagecreate($w,$h);    
 } else {
     $imgStrip = imagecreatetruecolor($w,$h);
+    imagealphablending($imgStrip, false);
+    imagesavealpha($imgStrip, true);
+    
 }
 imagefill($imgStrip, 0, 0, imagecolorallocatealpha($imgStrip, 0,0,0,127));
 
@@ -183,7 +188,7 @@
 
 function printHelp() {
     echo "Usage:\n\n";
-    echo "    php imagestrip.php -css <css file name> -o <image strip name> <image> ...\n\n";
+    echo "    php imagestrip.php [--vertical | --horizontal] [--append] [--verbose] -css <css file name> -o <image strip name> <image> ...\n\n";
     echo "-css <css file name> specifies the name of the css file to create,\n";
     echo "                     default is imagestrip.css if not specified.\n\n";
     echo "-o <image strip name> specifies the name of the image strip file to create,\n";
@@ -192,5 +197,9 @@
     echo "                      the extension of the output image strip file name.\n\n";
     echo "-d <depth> specify the bit depth of the image (8 or 24) for formats that\n";
     echo "           support it (jpeg is always 24 and gif is always 8).\n\n";
+    echo "--vertical specify that the images should be concatenated vertically\n\n";
+    echo "--horizontal specify that the images should be concatenated horizontally\n\n";
+    echo "--append specify that the images should be appended to an existing image\n";
+    echo "         rather than replacing it.\n\n";
 }
 ?>



More information about the fusion-commits mailing list