Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagepalettetotruecolor not found #225

Closed
ArvyRogerio opened this issue May 17, 2018 · 1 comment
Closed

imagepalettetotruecolor not found #225

ArvyRogerio opened this issue May 17, 2018 · 1 comment
Labels

Comments

@ArvyRogerio
Copy link

ArvyRogerio commented May 17, 2018

For some reason, my Raspberry 3 running CentOS 7 (ARM), PHP 5.6.31, with GD, returns "imagepalettetotruecolor not found" error on SimpleImage... Did I miss something?

Linux raspberry 4.9.80-v7.1.el7 #1 SMP Thu Mar 15 13:29:03 UTC 2018 armv7l armv7l armv7l GNU/Linux
PHP 5.6.31 (cli) (built: Sep 26 2017 14:03:31)
GD Version | bundled (2.1.0 compatible)

I've fixed inserting this function on simpleimage.php. Maybe can help others.

if (!function_exists('imagepalettetotruecolor')) {
   function imagepalettetotruecolor(&$src) {
       if (imageistruecolor($src)) return(true);
       $dst = imagecreatetruecolor(imagesx($src), imagesy($src));
       imagecopy($dst, $src, 0, 0, 0, 0, imagesx($src), imagesy($src));
       imagedestroy($src);
       $src = $dst;
       return(true);
    }
}
@claviska
Copy link
Owner

I'm guessing your version of GD was compiled without support for that method. I haven't seen this happen in hosting environments, and there's nothing mentioned for that function in the PHP manual so I'm not sure.

Thanks for the shim. If anyone else is experiencing this, please comment below. If it turns out to be more than an edge case, it may be worth shimming the lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants