getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 444 forks source link

Testing supported image formats in a gallery #3672

Open tartley opened 1 year ago

tartley commented 1 year ago

Environment

Python Version: 3.10.6 Nikola Version: git latest (commit 483ffd8f Wed Mar 1 22:52:02 2023) Operating System: Linux Pop!_OS 22.04 LTS (Derived from Ubuntu 22.04) Browser: Firefox 110.0.

Description:

I manually tested all the supported image formats in galleries. I plan to submit some fixes for the problems I found, but I know nothing, so let's discuss here & correct my misunderstandings first.

I infer the supported image file name extensions are defined at nikola/image_processing.py:46, which equates to:

bmp, gif, jpeg, jpg, png, svg, svgz, tiff, webp

In a brand new site, generated using nikola init -dq site, I tried each of the above image types in a gallery, specifically:

'y' in the table below means everything worked as I expected. Also, I record some diagnostic information:

Testing Results

Extension Build
site
Image
preview
View
image
baguetteBox
support
.guess_type(x)
.bmp y y KINDA[4] NO,BUT[5] ('image/bmp', None)
.gif y y y y ('image/gif', None)
.jpeg y y y y ('image/jpeg', None)
.jpg y y y y ('image/jpeg', None)
.png y y y y ('image/png', None)
.svg y y KINDA[4] NO,BUT[5] ('image/svg+xml', None)
.svgz y NO[2] KINDA[4] NO,BUT[5] ('image/svg+xml', 'gzip')
.tiff y NO[3] NO[3] NO,BUT[5] ('image/tiff', None)
.webp y (recently fixed in #3671) y y y (None, None) [1]

Perhaps a suitably simplified and user-oriented version of the above table would be useful in user-facing documentation about images and galleries?

Proposed actions