[fusion-commits] r1538 - trunk/utils
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Sep 16 14:14:11 EDT 2008
Author: pagameba
Date: 2008-09-16 14:14:11 -0400 (Tue, 16 Sep 2008)
New Revision: 1538
Modified:
trunk/utils/imagestrip.php
Log:
always use truecolor to compose the image and then convert to a paletted image if necessary.
Modified: trunk/utils/imagestrip.php
===================================================================
--- trunk/utils/imagestrip.php 2008-09-16 18:04:18 UTC (rev 1537)
+++ trunk/utils/imagestrip.php 2008-09-16 18:14:11 UTC (rev 1538)
@@ -147,18 +147,14 @@
}
}
-echo "image strip size: $w x $h\n";
-
-if ($depth == 8) {
- $imgStrip = imagecreate($w,$h);
-} else {
- $imgStrip = imagecreatetruecolor($w,$h);
- imagealphablending($imgStrip, false);
- imagesavealpha($imgStrip, true);
-
+if ($verbose) {
+ echo "image strip size: $w x $h\n";
}
-imagefill($imgStrip, 0, 0, imagecolorallocatealpha($imgStrip, 0,0,0,127));
+$imgStrip = imagecreatetruecolor($w,$h);
+$nTransparent = imagecolorallocate($imgStrip, 0,0,0);
+imagefill($imgStrip, 0, 0, $nTransparent);
+
$x = 0;
$y = 0;
foreach($imgObjects as $imgObject) {
@@ -174,6 +170,10 @@
switch($stripType) {
case 'png':
+ if ($depth == 8) {
+ imagetruecolortopalette($imgStrip, false, 256);
+ imagecolortransparent($imgStrip, $nTransparent);
+ }
imagepng($imgStrip, $stripFile);
break;
case 'gif':
More information about the fusion-commits
mailing list