Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter sevasargsyan

    (@sevasargsyan)

    How do I check if a webp file exists on the frontend?

    Plugin Author kubiq

    (@kubiq)

    Just read FAQ section

    https://wordpress.org/plugins/images-to-webp/#how%20to%20check%20if%20plugin%20works%3F

    https://ps.w.org/images-to-webp/assets/screenshot-3.png

    Images are not converted when new webp image filesize is bigger than original image size

    Thread Starter sevasargsyan

    (@sevasargsyan)

    And how do I check on the frontend whether the picture is generated ?

    Plugin Author kubiq

    (@kubiq)

    Just open these 2 links I’ve sent you above…

    Type = webp

    Thread Starter sevasargsyan

    (@sevasargsyan)

    the markup is like this for me, I have to check if the picture is not converted, then we output jpg

    <picture>
    	
        <source srcset="img/img.webp" type="image/webp">
        <img src="img/img.jpg" class="img-cover" alt="">
    </picture>
    Plugin Author kubiq

    (@kubiq)

    that’s not how this plugin works

    it will automatically serve correct content

    if browser doesn’t support WEBP then it will load original content from JPG/PNG and you don’t need to do any fancy markups for that

    Thread Starter sevasargsyan

    (@sevasargsyan)

    Just open these 2 links I’ve sent you above…

    Type = webp

    I have already read this 100 times, and it does not describe in any way how to check whether the picture is converted or not

    Plugin Author kubiq

    (@kubiq)

    If there is type = webp then it is converted and loaded.

    You can also add .webp to the image url and you will see if you will receive 404 or the image.

    Or check FTP if the file exists…

    But I don’t understand why you need this… everything is automated and you don’t need to check anything or do anything.

    Thread Starter sevasargsyan

    (@sevasargsyan)

    Can you briefly explain how I can output a picture to this block ?

    <picture>
    	
        <source srcset="img/img.webp" type="image/webp">
        <img src="img/img.jpg" class="img-cover" alt="">
    </picture>
    Thread Starter sevasargsyan

    (@sevasargsyan)

    <picture>
    	
        <source srcset="<?php the_post_thumbnail_url('thumb_articles'); ?>.webp" type="image/webp">
        <img src="<?php the_post_thumbnail_url('thumb_articles'); ?>" class="img-cover" alt="">
    </picture>

    Am I displaying the picture correctly ?

    • This reply was modified 1 year, 3 months ago by sevasargsyan.
    Plugin Author kubiq

    (@kubiq)

    This is wrong syntax.
    As I wrote – that’s not how it should work.

    Just output normal image with any default WP function and everything will work automatically. For example use wp_get_attachment_image()

    Plugin Author kubiq

    (@kubiq)

    No, you should not use <picture> tag to server different formats – that is done automatically by the plugin

    Thread Starter sevasargsyan

    (@sevasargsyan)

    The plugin does not create a

    <picture>
    Plugin Author kubiq

    (@kubiq)

    yes, it will not change your HTML and it will not change the URL, only thing that is changed is the source code of the image file loaded in the browser

    it will load WEBP content for browsers that support WEBP

    and it will load original JPG/PNG content for browsers that does not support WEBP

    thanks to that it will work everywhere – in CSS background images, classic <img> tags or wherever else… and you don’t need to change any single line of code

    just check your devtools Network tab if you see WEBP in Type column for images – if yes, then everything works

    Thread Starter sevasargsyan

    (@sevasargsyan)

    just check your devtools Network tab if you see WEBP in Type column for images – if yes, then everything works

    Yes there is such a thing

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Not converted’ is closed to new replies.