Thumbnails for animated WebP images?

WebP images don't automatically get a thumbnail in ZenPhoto. After finding your trick of uploading a JPG image (used as a thumbnail) with the same name as the WebP image (and lower case letters only and no underscore), I was quite happy that it worked until I found out that it doesn't work with animated WebP images.
Is there another trick to get animated WebP images to work with thumbnails?

Comments

  • acrylian Administrator, Developer

    WebP images don't automatically get a thumbnail in ZenPhoto.

    Actually it does as Zenphoto has built in support for webp for some time for both our supported graphic handlers GD and Imagick (don't remember when it was added exactly).

    Zenphoto 1.6 fixed an issue with those, so if you are not on 1.6 you should upgrade anyway.

    If it still doesn't work one of your server's graphic libs GD and Imagick - try both for differences! - may not support it respectively are compile without support for some reason. In that case please contact your host about that.

    The way you describe is the "sidecar" image approach.There is no limit regarding lowercase or no underscores, the filename minus suffix must be exact as the "main" file. Depends on your server being case sensitive or insensitive regarding the file system though.

  • Gagala Member
    edited August 2023

    Thanks for the help.

    Yes, I was wrong about the lowercase with WebP images, my bad.

    I took a look at my server's PHP (7.4) settings and there is "GD" and "Imagick" already enabled. WebP images work fine, only WebP animations don't get a thumbnail. Does this work on your side?

  • acrylian Administrator, Developer

    I don't have any webp animations at hand right but try to take a look later.

  • acrylian Administrator, Developer

    Thanks, that's helpful. Will report. At least for GD I don't need to test, it simply can't handle animated webp:

    Note that animated WebP files cannot be read.

    https://www.php.net/manual/de/function.imagecreatefromwebp.php

    For Imagick I have not yet found anything but will test.

  • acrylian Administrator, Developer

    I tried on my local server with Imagick directly without our graphicslib wrapper. It cannot even read the image and results in an exception about the encoding not being supported. No idea if it is just that example image…

    According to some docs it should be able to read webp animations if it can read webp and then with some extra work to extract a frame from it.

    I fear you have to do this manually the "sidecar" way.

  • Err... and how does this "sidecar" way work? Do you have a link where I can find out more?

  • acrylian Administrator, Developer

    You basically used and described the "sidecar" way above yourself.

  • Well... I tried this and it failed, so I thought it would fail for all WebP images until I found out it's only for animated images. This works like a charm with MP4 files.
    So I will hope and wait. Thank you for your time.

  • acrylian Administrator, Developer
    edited August 2023

    I see, of course the problem here is that Zenphoto just cannot process animated webp, so just haveing a sidecar thumb will not work as on the image page it also fails to resize. You would have to modify the theme to display the original instead or link to a full image.

    Only workaround would be to use the anyfile plugin for any non image file type and use a different custom suffix like for example .webpa to differ from normal webps and or something.

    Sorry, no other way if the libs cannot read it at all apparently. Alternativey you could convert them into mp4…

  • The idea of converting all animated WebP images to MP4 only works for sizes up to 2k (1080p). I have animations up to 8k, but no application to convert them. I tried several online applications that offer to convert such files, even up to 8k, but the results for files larger than 2k are less than bad.

    I just added the class-AnyFile plugin and renamed the file to .webpa, but now this file doesn't even appear in the image list of the album editor. Is there anything else I need to do that I missed?

  • acrylian Administrator, Developer

    You need to add the suffix .webpa on the plugin options so anyfile knows about it as well.

  • It doesn't work. I added the suffix webpa (like 7z and zip) to the class-AnyFile plugin and added a jpg file with the same name as the thumbnail. Only the name is displayed, not the thumbnail. Clicking on it will only show a mini "broken form" icon, no download option available.

    Meanwhile, something that used to work doesn't work anymore. I have several pdf files with a jpg with the same name, that still works like a charm, but now I can't upload a pdf file with a jpg thumbnail anymore, even if I download a pair of such working files and upload them again into another folder, the thumbnail isn't shown, the file is still readable. My site was temporarily down (PHP issues with another application). The support team of my web server had to help. Now the site is back online, but obviously something is different. How can I find out what was changed so I can get the pdf icons (for new uploaded files) working again?

  • acrylian Administrator, Developer

    It does work on both my local server with 1.6.1a and our own live server with 1.6. I can only assume this is some server (security) configuration interefering. `webpa" might not be a real suffix the server actually knows so perhaps just rejects it.

    For the pdfs could be the same or they messed up the file/folder permissions. You should have something in your log. If it worked before the server issue and the install has not been change, it is likey not Zenphoto.

  • As a mediator between two parties, I don't feel very comfortable with that at all.

    My Web Supporter Help Team changed some PHP settings and added missing plugins, but didn't tell me which ones. The result was that the thumbnails for PDF files worked again, but the animated WebP didn't play anymore. Now they wrote me this:

    "Please check the following information with the developers:
    If we add .webp suffixes in AnyFile plugin, the thumbnail is drawn, but the webp file itself is not displayed, there is no webp call on the page, only thumbnails (scr_1)
    If you remove suffixes .webp in AnyFile plugin, then the thumbnail is not drawn and the link leads only to jpeg. At the same time the link https://www.gagala.org/z/Special/2k-Silver/KP/KiBunch003.webp, the .webp itself becomes available, but it is not played (scr_2).
    If we repeat step two, but remove the line s=595 from the parameters of the .webp element, the picture starts to play (scr_3 and scr_4)."

    Attachments:
    https://www.gagala.org/thumbs/scr_1.jpg
    https://www.gagala.org/thumbs/scr_2.jpg
    https://www.gagala.org/thumbs/scr_3.jpg
    https://www.gagala.org/thumbs/scr_4.jpg

  • I just did a test upload, an animated WebP image, and it worked, no thumbnail, but it was playable. I added a JPG file of the same as the thumbnail, which was ignored. So it's the same status as before. I don't understand it. Sorry to bother you again.
    It seems there is nothing to do about it.

  • acrylian Administrator, Developer
    edited August 2023

    As mentioned above the graphic libraries GD and Imagick do not support processing animate webp images. There is nothing we can do about that.

    Anyfile is a workaround to list non images files - except video and audio that are directly supported - within the gallery. To have a thumbnail you need to upload a sidecar image.

    To have the animated webp shown on the image page of your theme directly you need to customize the image page of your theme to show the full image - the unpreocesed original image that is - instead of a (re)sized image. Thumbs are sized images and therefore this naturally also doesn't work.

    Anyfile is generic so we don't know what should happen with a speciflc file format.

    See the glossaryand review the themeing tutorial on your site about the basics of all this.

Sign In or Register to comment.