summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rwxr-xr-xsrc/PHPImageWorkshop/ImageWorkshop.php17
2 files changed, 13 insertions, 7 deletions
diff --git a/README.md b/README.md
index c43f674..e81e94a 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,9 @@ http://phpimageworkshop.com/
### Latest updates
+**Version 1.3.1 - 2012-10-17**
+- Fixing a transparency bug when saving a layer as PNG which has no sublayer.
+
**Version 1.3.0 - 2012-10-11**
- You are able to apply a horizontal or vertical flip (transformation) on a layer:
diff --git a/src/PHPImageWorkshop/ImageWorkshop.php b/src/PHPImageWorkshop/ImageWorkshop.php
index 86ea81b..6816300 100755
--- a/src/PHPImageWorkshop/ImageWorkshop.php
+++ b/src/PHPImageWorkshop/ImageWorkshop.php
@@ -8,7 +8,7 @@ namespace PHPImageWorkshop;
* Powerful PHP class using GD library to work easily with images including layer notion (like Photoshop or GIMP).
* ImageWorkshop can be used as a layer, a group or a document.
*
- * @version 1.3.0
+ * @version 1.3.1
* @link http://phpimageworkshop.com
* @author Sybio (Clément Guillemain / @Sybio01)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -1343,14 +1343,17 @@ class ImageWorkshop
$iterator++;
}
-
+
+ $opacity = 127;
+
if ($backgroundColor) {
-
- $backgroundImage = static::generateImage($this->width, $this->height, $backgroundColor, 0);
- static::mergeTwoImages($backgroundImage, $mergedImage);
- $mergedImage = $backgroundImage;
- unset($backgroundImage);
+ $opacity = 0;
}
+
+ $backgroundImage = static::generateImage($this->width, $this->height, $backgroundColor, $opacity);
+ static::mergeTwoImages($backgroundImage, $mergedImage);
+ $mergedImage = $backgroundImage;
+ unset($backgroundImage);
return $mergedImage;
}