mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Preserve transparency in thumbnails
Summary: Add some code from a random guy on the Internet. Test Plan: Upload a PNG file with alpha; check thumbnail. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1646 Differential Revision: https://secure.phabricator.com/D3258
This commit is contained in:
parent
1379876db7
commit
29e176fe53
1 changed files with 2 additions and 0 deletions
|
@ -88,6 +88,8 @@ final class PhabricatorImageTransformer {
|
|||
|
||||
$scale = min($x / $dx, $y / $dy);
|
||||
$dst = imagecreatetruecolor($dx, $dy);
|
||||
imagesavealpha($dst, true);
|
||||
imagefill($dst, 0, 0, imagecolorallocatealpha($dst, 0, 0, 0, 127));
|
||||
|
||||
// If we need to chop off some pixels, chop them off from the sides instead
|
||||
// of scaling in on <0, 0>.
|
||||
|
|
Loading…
Reference in a new issue