소스 검색

Enable theming background transparency

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
tags/v21.0.0beta1
John Molakvoæ (skjnldsv) 3 년 전
부모
커밋
68f1f44e58
No account linked to committer's email address
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      apps/theming/lib/ImageManager.php

+ 5
- 1
apps/theming/lib/ImageManager.php 파일 보기

@@ -228,13 +228,17 @@ class ImageManager {
// either to big or are not progressive rendering.
$newImage = @imagecreatefromstring(file_get_contents($tmpFile));

// Preserve transparency
imagesavealpha($newImage, true);
imagealphablending($newImage, true);

$tmpFile = $this->tempManager->getTemporaryFile();
$newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096);
$newHeight = (int)(imagesy($newImage) / (imagesx($newImage) / $newWidth));
$outputImage = imagescale($newImage, $newWidth, $newHeight);

imageinterlace($outputImage, 1);
imagejpeg($outputImage, $tmpFile, 75);
imagepng($outputImage, $tmpFile, 8);
imagedestroy($outputImage);

$target->putContent(file_get_contents($tmpFile));

Loading…
취소
저장