[fusion-commits] r1633 - trunk/utils
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue Nov 4 07:53:53 EST 2008
Author: pagameba
Date: 2008-11-04 07:53:53 -0500 (Tue, 04 Nov 2008)
New Revision: 1633
Modified:
trunk/utils/imagestrip.php
Log:
build true color output images correctly.
Modified: trunk/utils/imagestrip.php
===================================================================
--- trunk/utils/imagestrip.php 2008-11-04 12:53:11 UTC (rev 1632)
+++ trunk/utils/imagestrip.php 2008-11-04 12:53:53 UTC (rev 1633)
@@ -152,15 +152,29 @@
}
$imgStrip = imagecreatetruecolor($w,$h);
-$nTransparent = imagecolorallocate($imgStrip, 0,0,0);
-imagefill($imgStrip, 0, 0, $nTransparent);
+if ($depth == 8) {
+ $nTransparent = imagecolorallocate($imgStrip, 0,0,0);
+ imagefill($imgStrip, 0, 0, $nTransparent);
+} else {
+ $nTransparent = imagecolorallocatealpha($imgStrip, 0, 0, 0, 127);
+ imagefill($imgStrip, 0, 0, $nTransparent);
+ imagealphablending($imgStrip, false);
+ imagesavealpha($imgStrip, true);
+}
$x = 0;
$y = 0;
foreach($imgObjects as $imgObject) {
$w = imagesx($imgObject);
$h = imagesy($imgObject);
- imagecopy($imgStrip, $imgObject, $x, $y, 0, 0, $w, $h);
+ if (imageistruecolor($imgObject)) {
+ // this should be imagecopymerge according to the docs
+ // but that doesn't work correctly
+ echo "true color\n";
+ imagecopy($imgStrip, $imgObject, $x, $y, 0, 0, $w, $h);
+ } else {
+ imagecopy($imgStrip, $imgObject, $x, $y, 0, 0, $w, $h);
+ }
if ($direction == 'horizontal') {
$x += $w;
} else {
More information about the fusion-commits
mailing list