extract transparency fix from #8050
This commit is contained in:
parent
38e309b0fe
commit
fa461befbc
|
@ -870,6 +870,14 @@ class OC_Image {
|
||||||
imagedestroy($process);
|
imagedestroy($process);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// preserve transparency
|
||||||
|
if($this->imageType == IMAGETYPE_GIF or $this->imageType == IMAGETYPE_PNG) {
|
||||||
|
imagecolortransparent($process, imagecolorallocatealpha($process, 0, 0, 0, 127));
|
||||||
|
imagealphablending($process, false);
|
||||||
|
imagesavealpha($process, true);
|
||||||
|
}
|
||||||
|
|
||||||
imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
|
imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
|
||||||
if ($process == false) {
|
if ($process == false) {
|
||||||
OC_Log::write('core', __METHOD__.'(): Error resampling process image '.$w.'x'.$h, OC_Log::ERROR);
|
OC_Log::write('core', __METHOD__.'(): Error resampling process image '.$w.'x'.$h, OC_Log::ERROR);
|
||||||
|
|
Loading…
Reference in New Issue