• Resolved phodestravel

    (@phodestravel)


    Hello,
    Thank you for the plugin!
    I would like to convert all images on my site to .webp.
    I am wondering if your plugin supports that format.
    If so what changes should be done, if not are you considering to support .webp in the future?

    Thank you
    iryna

    • This topic was modified 5 years, 12 months ago by phodestravel.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Adding webp is just a simple change – just add the extension in line 235 of lightbox-photoswipe.php:

    OLD:

    if (in_array($type['ext'], array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico'))) {

    NEW:

    if (in_array($type['ext'], array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'webp'))) {

    I’ll add this with the next update.

    However: support for webp requires at least PHP 7.1. Older version don’t support reading the image size from webp images. PHP 7.1 should be the minimum used version anyway, as PHP 5.6 is outdated and not supported any longer. But you should check the hosting environment just to be sure.

    Plugin Author Arno Welzel

    (@awelzel)

    I just pushed an update which now also supports WebP. Just be aware, that at least PHP 7.1 is required.

    Thread Starter phodestravel

    (@phodestravel)

    Hello Mr.Welzel,
    Thank you for the quick update!
    It works!
    But… as you may know, the WebP format is not supported by Safari yet. A fallback should be done, i.e. to use <picture> and <source> tags
    I found a very good explanation here https://gulshankumar.net/how-to-serve-webp-format-images-in-wordpress/.
    So my question is
    Is it possible to recreate that functionality in your plugin?
    I see it like this: I upload to WP 2 types of images (.WebP and .jpeg) and your plugin takes care of the rest.

    Thank you
    iryna

    Plugin Author Arno Welzel

    (@awelzel)

    Changing the way how WordPress handles images would be possible technically, but this is out of scope for my plugin, sorry. There are other plugins available to deal with WebP images, maybe you should give them a try (I did not test them myself yet, but the descriptions sound promising):

    https://www.ads-software.com/plugins/media-webp/

    https://www.ads-software.com/plugins/webp-express/

    https://www.ads-software.com/plugins/opti-mozjpeg-guetzli-webp/

    Edit: I’ll try these plugins on my demo site to check if there are any compatibility issues with Lightbox with PhotoSwipe.

    • This reply was modified 5 years, 11 months ago by Arno Welzel.
    Thread Starter phodestravel

    (@phodestravel)

    Hello, Mr.Welzel
    Thank you!
    I will appreciate if you can give me your feedback about the compatibility.
    I love your plugin and I would like to continue using it…with WebP.

    Looking forward to the results of your tests.
    iryna

    Thread Starter phodestravel

    (@phodestravel)

    …on my side, although I am not a fan of having too many plugins, I will install WepP Express on my local to see how it works with your plugin.

    P.S. Thank you for the plugin list!

    Thread Starter phodestravel

    (@phodestravel)

    Hello, Mr.Welzel
    As I said, I have tried to use WebP Express plugin on my local server. Unfortunately, any of the methods to convert images are not available on my server.
    I really need to know your feedback/opinion before going forward.

    Thank you
    iryna

    Plugin Author Arno Welzel

    (@awelzel)

    Sorry, I did not have time yet to check all the plugins I mentioned. If they don’t work, I can’t help you at the moment.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Support WebP images’ is closed to new replies.