Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1139518

    Hi, I have almost implemented the webp image format. I need to be able to preview the images or thumbails.

    Imagen

    I found this function but I apply it and it doesn’t work

    //enable preview / thumbnail for webp image files.
    function webp_is_displayable($result, $path) {
        if ($result === false) {
            $displayable_image_types = array( IMAGETYPE_WEBP );
            $info = @getimagesize( $path );
    
            if (empty($info)) {
                $result = false;
            } elseif (!in_array($info[2], $displayable_image_types)) {
                $result = false;
            } else {
                $result = true;
            }
        }
    
        return $result;
    }
    add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
    

    Thank you.

    Greetings!

    #1140508

    Hey Ganubis,
    Sorry for the late reply, unfortunately, this function doesn’t work for me in showing a thumbnail and my research finds that even with the ability to upload the file type to the media library, which I could, WordPress can not create a thumbnail from the file.
    I also tested this in the default WordPress theme but the thumbnail still would not show, interesting webp is not supported in Safari so it may be more trouble than it’s worth at this time. As this is a core WordPress limitation, I’m not sure how we can further help.

    Best regards,
    Mike

    #1140795

    Hi Mike, Thank you very much for answering.

    Yes, I was thinking the same. It seems early to start using directly only webp images.

    Thanks, Mike!!

    #1140798

    Hi,
    Thank you for bringing this up, I’m sure it won’t be too long before this becomes a new standard, but we will have to wait for iPhone to support it then WordPress will probably push it.
    We will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Enable preview / thumbnail for webp image files’ is closed to new replies.