Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

PNG with transparency in images manager #1132

Closed
sashabeep opened this issue Dec 21, 2016 · 10 comments
Closed

PNG with transparency in images manager #1132

sashabeep opened this issue Dec 21, 2016 · 10 comments
Labels

Comments

@sashabeep
Copy link
Contributor

Thumbs for PNGs with transparency with black background

2016-12-21 13 38 08

@sashabeep sashabeep changed the title PNG with transparency in imeges manager PNG with transparency in images manager Dec 21, 2016
@Deesen
Copy link
Contributor

Deesen commented Dec 21, 2016

This seems to be a server-setting / php-extension issue. For me on some servers BG is correct, on others BG turns black.

@sashabeep
Copy link
Contributor Author

By default only GD is supported in mcpuk, but KCFinder seems to be more customizeable. How to switch from GD to imagick in mcpuk?

@risingisland
Copy link

Looks like this could probably be used:

'imageDriversPriority' => "gmagick imagick gd",

@sashabeep
Copy link
Contributor Author

Tried to add this line to config.php and even changed

/** Default image driver
  * @var string */
    protected $imageDriver = "imagick";

in core/uploader.php
but seems like nothing happened. imagick is on

@bossloper
Copy link
Contributor

Older version of KCFinder (2.51) works ok. It is the 2.54 version that has introduced a bug.
The problem is here: https://github.com/modxcms/evolution/blob/develop/manager/media/browser/mcpuk/core/uploader.php#L671-#L679

A quick test by changing the return:

return $img->output("png", array( 'file' => $thumb, 'quality' => null ));

and a new png uploaded displays correctly for me. So it is not a graphic driver issue.
It was apparently fixed in a later version of KCFinder:
sunhater/kcfinder#84

But above the fix cannot simply be applied to 2.54 as the code is quite different.

@Dmi3yy Dmi3yy added the 1.2.1 label Dec 28, 2016
@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Dec 28, 2016

test this: sunhater/kcfinder#84 but its not help

http://take.ms/y7dVW
http://take.ms/aCwHk

@bossloper
Copy link
Contributor

bossloper commented Dec 28, 2016

Yes the patch is for something very similar but also a later version so is not a direct patch.
Wondering why we are using KCFinder 2.54 and not 3.12. Is it because it has a php 5.3 minimum or are there other issues?

@janniconl
Copy link

janniconl commented Dec 28, 2016

Also discussed before here: #663

I think the problem here is that the thumbnails are generated as .JPG, while the source image is .PNG

Possible solutions/similar issues:
http://stackoverflow.com/questions/19953600/php-thumb-resize-png-image-but-add-black-background
masterexploder/PHPThumb#116
masterexploder/PHPThumb#58

Maybe make thumbnails PNG when source is PNG? Of just set the background to white when converting > PNG to JPG?

@fourroses666
Copy link
Contributor

So thumbs will be .png in the next version?!
Thats a good solution.

@Dmi3yy Dmi3yy added bug and removed 1.2.2 labels Mar 21, 2017
@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Jul 15, 2017

Fixed in 1.2.2

@Dmi3yy Dmi3yy closed this as completed Jul 15, 2017
Dmi3yy added a commit that referenced this issue Nov 25, 2019
fix (core) Fast fix for add save checkbox usergroup in module
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants