• Resolved lucasbustamante

    (@lucasbustamante)


    Hey, first of all, thanks for the plugin.

    When converting using WP CLI I get the following error:

    Fatal error: gd-webp encoding failed in /home/webs/public_html/wp-content/plugins/webp-converter-for-media/src/Conversion/Method/GdMethod.php on line 201

    I can confirm my PHP has gd module, and that the conversion on the UI appears to be working.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @lucasbustamante,

    Thank you for your message.

    It seems that the Gd library installed on your server has a problem with the library saving WebP files. Unfortunately this is plugin independent.

    In the plugin settings, in the Advanced Settings tab, you can choose a different image conversion method – Imagick or Remote server. Please try using these settings.

    Best,
    Mateusz

    Thread Starter lucasbustamante

    (@lucasbustamante)

    While processing through the UI, I see that some items are skipped/fails, I wonder if this is more strict in CLI and is throwing an error instead?

    eg:

    Saving the weight of your images: 109.77 MB (51%)
    Successfully converted files: 731
    Failed or skipped file conversion attempts: 39

    Maybe if on CLI, it could have some kind of logic to bail only if it’s failing too much?

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @lucasbustamante Images are then skipped if the converted image does not weigh less than the original image. This happens when converting images to WebP format, where the original image is small and has been previously optimized, or when a higher strategy than the default is used in the plugin settings.

    Thread Starter lucasbustamante

    (@lucasbustamante)

    You’re correct.

    • In my case, GD uses WebP from system
    • And my libwebp version is 0.3.0, released in 2013. Latest version is 1.3.2.
    ~ rpm -qa | grep webp
    alt-libwebp-1.2.2-1.el7.x86_64
    libwebp-0.3.0-11.el7.x86_64

    I’ll probably download these 155k images to my computer and optimize it locally, then replace it.

    Just as a sidenote, it would be awesome if the CLI command would take a path as a parameter, this way I could parallelize it. I’ve been processing it for the past 8 hours (on CLI) and it’s still 40%. I got blocked by the firewall trying to process it using the AJAX/UI approach.

    Thanks for the awesome plugin!

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @lucasbustamante Thank you for the confirmation!

    You can always use Remote server – then you will bypass the restrictions associated with the older PHP library. You will also gain access to the AVIF format, which offers much better features compared to the WebP format. Images converted to the AVIF format will weigh about 50% less than images converted to WebP only, maintaining even better image quality.

    The process launched by WP-Cli is obviously faster than doing it through the WordPress dashboard. The performance of the process depends on the performance of the server. If 60,000 images are processed for 8 hours, it means that your server is very slow. Running multiple processes at the same time wouldn’t make it go any faster.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP-CLI: Fatal error: gd-webp encoding failed’ is closed to new replies.