Skip to main content

Enable WebP Support for ImageMagick in PHP 7.4 (ea)

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey there! I actually wrote an article on this a while back that you can see here:
    0
  • jethrodesign
    Hi cP Rex, thanks for the quick reply. Yes, as mentioned, we are aware that WebP is supported in GD. We do have that option currently. But as also mentioned, we would prefer to use ImageMagick, as that has some advanced features that we prefer to utilize. For instance, ImageMagick allows the option to retain ICC Profiles, where GD does not. We prefer to retain profiles for best color consistency across all platforms. There are a couple other options as well. - Anyone have any insight on enabling this for ImageMagick?
    0
  • cPRex Jurassic Moderator
    Thanks for those details. It's actually an issue with CentOS not including support for that package, which you can find more details on here:
    0
  • jethrodesign
    Hmm, OK. And if CentOS doesn't include it, then CloudLinux doesn't either, right? - So is it something that has to be 'bundled' with the OS, as opposed to just installing it straight out? -
    0
  • cPRex Jurassic Moderator
    CloudLinux does often go above and beyond the packages that are included with CentOS, so you may be able to use alt-php to get that tool working if you have a CloudLinux machine. I can't speak to the instructions in that article as we don't recommend trying to install things from source on a cPanel server as there could be conflicts either immediately or with future updates.
    0
  • cPanelAustin
    @jethrodesign, I know that this is quite late, but I've put some time and research into this topic to see if I could find a way to get this working. As a result, I've published the following guide that explains how to get the webp format working with ImageMagick on cPanel:
    0
  • jethrodesign
    Hi, thanks for the reply! Much appreciated. We actually had our sys admin try to install & compile ImageMagick from scratch, adding WebP support. But in the end we started getting a bunch of 'php-cgi killed by SIGSEGV' error notifications when uploading images using the EA4 versions of PHP after this. With CentOS & CloudLinux both having their own versions of ImageMagick/Imagick, and the additional restrictions cPanel may add, it was just a bit too convoluted to make it happen in a reliable fashion, and feel safe leaving it with anything beyond what is 'stock', especially in regards to future updates. So we reverted everything back to what is stock/default. We had noticed that the ALT-PHP (CloudLinux) version of Imagick WAS compiled with WebP support, so we just figured we'd use that on accounts that really needed this feature. But alas, the version of libwebp that CloudLinux includes by default to give the WebP support to Imagick is ANCIENT (v.0.3.0 from 2013 or something?!?). So all of our efforts to enable an option of WebP we really need for quality (use-sharp-yuv) failed until we realized that option wasn't added until v.0.6.0 (2017). So I now have a ticket with the CloudLinux team trying to find out why such an ancient version of libwebp is included, and if that can be updated. We've already learned the hard way not to try to go beyond what is included by default, otherwise we might try to update that ourselves. All this just seems like a shame how 'locked down' everything appears to be with CentOS/CloudLinux/cPanel, at least if you want things to work reliably and not be broken by future updates. Feeling a bit trapped... Thanks again!
    0

Please sign in to leave a comment.