summaryrefslogtreecommitdiffstats
path: root/lib/preview.php
diff options
context:
space:
mode:
authorGeorg Ehrke <georg@ownCloud.com>2013-05-17 11:28:49 +0200
committerGeorg Ehrke <georg@ownCloud.com>2013-05-17 11:28:53 +0200
commit8dba46912d19bf976b24e0c097368f2e56ccb97b (patch)
treee01ed821b1b33e1d4ad99ec70a4cec149d3e31e1 /lib/preview.php
parent837c6ed597f1c549cac5b0b439b257d81ea02b1d (diff)
downloadnextcloud-server-8dba46912d19bf976b24e0c097368f2e56ccb97b.tar.gz
nextcloud-server-8dba46912d19bf976b24e0c097368f2e56ccb97b.zip
Disable transparent backgrounds for now
Diffstat (limited to 'lib/preview.php')
-rwxr-xr-xlib/preview.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/preview.php b/lib/preview.php
index c062a068872..44b551006f1 100755
--- a/lib/preview.php
+++ b/lib/preview.php
@@ -427,17 +427,21 @@ class OC_Preview {
$newYsize = (int) $image->height();
//create transparent background layer
- $transparentlayer = imagecreatetruecolor($x, $y);
- $black = imagecolorallocate($transparentlayer, 0, 0, 0);
+ $backgroundlayer = imagecreatetruecolor($x, $y);
+ $white = imagecolorallocate($backgroundlayer, 255, 255, 255);
+ imagefill($backgroundlayer, 0, 0, $white);
+
$image = $image->resource();
- imagecolortransparent($transparentlayer, $black);
$mergeX = floor(abs($x - $newXsize) * 0.5);
$mergeY = floor(abs($y - $newYsize) * 0.5);
- imagecopymerge($transparentlayer, $image, $mergeX, $mergeY, 0, 0, $newXsize, $newYsize, 100);
+ imagecopy($backgroundlayer, $image, $mergeX, $mergeY, 0, 0, $newXsize, $newYsize);
+
+ //$black = imagecolorallocate(0,0,0);
+ //imagecolortransparent($transparentlayer, $black);
- $image = new \OC_Image($transparentlayer);
+ $image = new \OC_Image($backgroundlayer);
$this->preview = $image;
return;