I am using a fresh LEMP Ubuntu 14.04 server with PHP Version 5.5.9. The version of the GD Library I’m uisng is 2.1.1-dev.
I am trying to use this function:
imagelayereffect($emblem, IMG_EFFECT_OVERLAY);
Here is my GD Library functions:
Function [ <internal:gd> function imagelayereffect ] {
My code for overlaying the banner is:
$emblem = imagecreatefrompng($emblemURL);
$emblem_size = getimagesize($emblemURL);
imagelayereffect($emblem, IMG_EFFECT_OVERLAY);
$emblemcolor = preg_replace('/^ff/i', '', $guild['emblem']['iconColor']);
$color_r = hexdec(substr($emblemcolor, 0, 2));
$color_g = hexdec(substr($emblemcolor, 2, 2));
$color_b = hexdec(substr($emblemcolor, 4, 2));
imagefilledrectangle($emblem, 0, 0, $emblem_size[0], $emblem_size[1], imagecolorallocatealpha($emblem, $color_r, $color_g, $color_b, 0));
The image I am trying to overlay is this: image 1. As you can see it overlays a square of brown and is not blending at all. I have also tried to do the example image in the PHP documentation on how to use imagelayereffect and got this result: image 2
I have changed Operating Systems to CentOS to see if that would make a difference, and it worked perfectly. I’m not sure what is wrong here or what I’m doing wrong, as I have researched a lot of this and cannot find a direct answer.
If anybody could shed some light on this it would be highly appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @dti:
Please note that php5-gd package is missing functions ( imageantialias, imagerotate, etc.) in Ubuntu. See https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1294074
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.