Publ: Test of image renditions

Last updated:
Source file: /home/fluffy/

Image rendition tests

Image rendition tests

External images

External image with width set


![](//{250} "so smol")

External image with height set


![](//{height=250} "less smol")

External image with width and height set, with different scaling modes:

Image using static path



Force absolute URLs


![{640,320,absolute=True}](// | @images/IMG_0377.jpg)

Local images

alt text

![alt text](rawr.jpg "test single image")

alt textalt textalt text

alt text

![alt text](rawr.jpg "test single image")

alt text




Inline image with a gallery class:

should still be a block element

Inline image with no gallery class: rawr.jpg should be inline

Paragraph-level image set without a gallery class:


should still be in a paragraph

such gallerysuch gallerysuch gallerysuch gallery

PNG transparency

Base image:

notsmiley.png ![](notsmiley.png)

converted to jpeg, no background:

notsmiley.png ![](notsmiley.png{format="jpg"})

converted to jpeg, black background:

notsmiley.png ![](notsmiley.png{format="jpg",background="black"})

converted to jpeg, red background using a tuple:

notsmiley.png ![](notsmiley.png{format="jpg",background=(255,0,0)})

converted to jpeg, white background using hex code:

notsmiley.png ![](notsmiley.png{format="jpg",background='#ccc'})

converted to jpeg, cyan background, multiple qualities on the spectrum:




Scale algorithms

Landscape_1.jpgLandscape_1.jpgLandscape_1.jpgLandscape_1.jpgLandscape_1.jpgLandscape_1.jpgLandscape_1.jpgError loading image Landscape_1.jpg{scale_filter=‘xyzzy’} "xyzzy": Invalid scale_filter value ‘xyzzy’

Broken/parse failures

  • ![broken image](missingfile.jpg)

    Image not found: missingfile.jpg

  • ![broken spec](foo{123[]})

    Couldn’t parse image spec: foo{123[]} invalid syntax (<unknown>, line 1)

  • ![broken spec](poiu{100} foo{200})

    Couldn’t parse image spec: poiu{100} foo{200} closing parenthesis ‘}’ does not match opening parenthesis ‘(’ (<unknown>, line 1)

  • ![broken imageset](rawr.jpg rawr.jpg)

    Image not found: rawr.jpg rawr.jpg (Did you forget a |?)

  • ![broken imageset](rawr.jpg "title rawr" rawr.jpg "title 2")

    Image not found: rawr.jpg "title rawr" rawr.jpg (Did you forget a |?)

  • ![partially broken image set](rawr.jpg "rawr!" | missingfile.jpg "missing")

    partially broken image setImage not found: missingfile.jpg

  • ![too many posargs](rawr.jpg{2,3,4})

    Couldn’t parse image spec: rawr.jpg{2,3,4} Expected at most 2 positional args but 3 were given

  • ![mulitple widths](rawr.jpg{100,width=200})

    Couldn’t parse image spec: rawr.jpg{100,width=200} Got multiple values for width