Support » Plugin: WebP Express » Redirect to Webp only for JPG

  • Right now I changed the .htaccess inside the uploads folder but can be handy to have as settings.
    We need the png for the transparency layer that in webp is missing.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author rosell.dk

    (@roselldk)

    There is the “Image types to work on” setting under “general”. Select “Only jpegs”

    Are you using Gd? I think only Gd has problems with transparency.
    Can you tell me which version of Gd you are using?

    Dammit I missed that setting…
    You are right I have only Gd on that machine, GD Version: bundled (2.1.0 compatible)
    I can ask to the hosting to install imagemagick

    Plugin Author rosell.dk

    (@roselldk)

    Do that!
    Gd is inferior to imagemagick and imagick.

    Thanks for the version number

    Plugin Author rosell.dk

    (@roselldk)

    Oh, by the way, can you show me the conversion log for an image that fails the transparency? Simply go to Media > WebP Express, browse to the image, click “Convert” and then click “View Conversion Log”.

    Converter set to: gd
    
    **WebP Convert 2.8.0 ignited** 
    PHP version: 7.4.26
    Server software: Apache
    
    source: /home/domain/public_html/wp-content/plugins/webp-express/test/alphatest.png
    destination: /home/domain/public_html/wp-content/webp-express/webp-images/plugins/webp-express/test/alphatest.png.webp
    
    **Gd converter ignited** 
    
    Options:
    ------------
    - encoding: "lossless"** (unsupported by gd)** 
    - quality: 85
    - near-lossless: 60** (unsupported by gd)** 
    - metadata: "none"** (unsupported by gd)** 
    - log-call-arguments: true
    - skip-pngs: **  (unknown to gd)** 
    
    Note that these are the resulting options after merging down the "jpeg" and "png" options and any converter-prefixed options
    
    Defaults:
    ------------
    The following options was not set, so using the following defaults:
    - auto-limit: true
    
    GD Version: bundled (2.1.0 compatible)
    image is true color
    BEWARE: Your version of Gd looses the alpha chanel when converting to webp.You should upgrade Gd, use another converter or stop converting PNGs. See: https://github.com/rosell-dk/webp-convert/issues/238
    Bypassing auto-limit (it is only active for jpegs)
    Quality: 85. 
    
    Converted image in 405 ms, reducing file size with 61% (went from 26 kb to 10 kb)
    
    Plugin Author rosell.dk

    (@roselldk)

    Thanks!

    Yes, it is as the warning says (“BEWARE: Your version of Gd looses the alpha chanel when converting to webp…”).

    I should actually show a warning sign next to Gd in the UI on these versions of Gd. But I guess it is pretty rare these days to be running on such an old Gd version.

    There is however one thing, I haven’t tried out.
    You could try to change this line:

    if (!imagealphablending($image, true)) {

    To this:
    if (!imagealphablending($image, false)) {

    In the file vendor/rosell-dk/webp-convert/src/Convert/Converters/Gd.php

    I installed imagemagick anyway 🙂

    I have also an issue in the modal https://imgur.com/a/TxyZuEB

    Plugin Author rosell.dk

    (@roselldk)

    Ok, I haven’t seen that before. My guess is that your have a bad-mannered plugin installed that changes the css for thickbox globally. Plugin writers are encouraged to use the libraries that comes with WordPress. So plugins uses the same libraries. Some plugins needs tweaks. Some plugin writers puts their tweaks on all admin pages. Just a guess

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Redirect to Webp only for JPG’ is closed to new replies.