We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Galleries do not allow width and height to be specified causing AMP issue

  • #5404
    Avatar photo[anonymous]

    I recently created a page with two image galleries – neat feature. But, while you can specify alt text for them, you can’t specify the width and height, neither does the processing behind the scenes examine the images and place width and height tags in the final HTML. I noticed this in the AMP version as the rules are strict and Google rejected the page highlighting this issue. Once I had manually editted the HTML of the page to add the width and height tags for the images, Google accepted the changed page met the rules.

    The (now corrected) page is at:

    Thoughts? Anything I am doing wrong?

    Avatar photo[anonymous]


    I will try to solve it in v.0.38.2:

    Avatar photo[anonymous]


    FYI – the issue seems to be related to WebP format – for other image formats it is ok ๐Ÿ™‚

    Avatar photo[anonymous]

    Ok, I have found a reason – if you are using Jimp as a resize engine (or you just use Linux version of the Publii app) then the images won’t have proper width/height attributes in gallery if they are using WebP. Unfortunately due issues with sharp library on linux, Publii currently does not support WebP on Linux ๐Ÿ™

    Avatar photo[anonymous]

    Thanks for investigating, really appreciate it. Although I am using WebP, I am not using Linux. I use standard Windows 10 version of Publii. I crop my images in Paint.NET andย  save them as WebP format because I find it gives the best filesize/performance ratio.

    The properties of the file saved by Paint.NET appear to be correct. Is it just a more widely spread issue with WebP files in Publii, and not just related to Publii Linux?

    I have attached one of the images in the gallery where I noticed the error. This attached image is from before it was imported into Publii.

    Avatar photo[anonymous]

    For me your image is working fine – please check if under App Settings you are using “Sharp” as resizing engine for images. If you are using “Jimp” it can explain a reason of your issue.

    Avatar photo[anonymous]

    It says Sharp.

    Just so you know, it took me 15 minutes to find the App Settings. It is hidden behind a crazy small, almost transparent and un-named icon. You might consider moving it to the left hand menu where everything else is, or at least label it and make it visible.

    Avatar photo[anonymous]

    Which version of Publii are you using? 0.38.1 or older one? Older version can also have issues with WebP.

    Avatar photo[anonymous]

    I am using 0.38.0

    I don’t think it is an issue with the format of the files, the Publii application itself does not give you the option to specify width and height in a gallery like you can for a single image.

    Avatar photo[anonymous]

    Publii generate image dimensions for images automatically – that’s why we did not add an option in gallery for it.

    Please update to the newest version of Publii and then please try to add your WebP image to the gallery again. Support for WebP has been added in 0.38.0 and earlier webp files were ignored in some cases so it could lead to lack of width/height attributes.