Supersedes #871
Currently, the <pic> tag allows width and height attributes, which do not make sense for a circle. Also, specifying a width for circle results in inconsistent behaviour due to cropping (see below).

<pic src="http://placehold.it/800x600" circle/>
<pic src="http://placehold.it/100x100" circle/>
<pic src="http://placehold.it/100x300" circle/>
<pic src="http://placehold.it/300x100" circle/>
---
<pic src="http://placehold.it/800x600" width=200 circle/>
<pic src="http://placehold.it/100x100" width=200 circle/>
<pic src="http://placehold.it/100x300" width=200 circle/>
<pic src="http://placehold.it/300x100" width=200 circle/>
---
<pic src="http://placehold.it/800x600"/>
<pic src="http://placehold.it/100x100"/>
<pic src="http://placehold.it/100x300"/>
<pic src="http://placehold.it/300x100"/>
The 800x600 image is resized to 200x150, preserving aspect ratio, which is then cropped to a circle with diameter 150px. The 100x100 and 100x300 are resized to 200x200 and 200x600, and cropped to circles with diameter 200px. The 300x100 circle is resized to 200x67, cropped to a circle with diameter 67px.
Furthermore, the circle attribute is not compatible with Bootstrap's img-fluid class behavior, which is default for <pic>.
In most use cases, the thumbnails should be consistently sized despite having sources of different dimensions, e.g. a Personnel page with a thumbnail for each person, it is important that the implementation supports this.
Apart from that, for extensibility and readability, it would be better to create a new component for this feature, rather than overloading the current <pic> component.
Proposed change: Implement the circle cutout feature as a new Vue component <thumb> which is a square crop by default, with an optional attribute to change it to a circle, and only supports one dimensional attribute size, which controls the side length for squares, or diameter for circles.
Supersedes #871
Currently, the
<pic>tag allowswidthandheightattributes, which do not make sense for a circle. Also, specifying awidthforcircleresults in inconsistent behaviour due to cropping (see below).The 800x600 image is resized to 200x150, preserving aspect ratio, which is then cropped to a circle with diameter 150px. The 100x100 and 100x300 are resized to 200x200 and 200x600, and cropped to circles with diameter 200px. The 300x100 circle is resized to 200x67, cropped to a circle with diameter 67px.
Furthermore, the
circleattribute is not compatible with Bootstrap'simg-fluidclass behavior, which is default for<pic>.In most use cases, the thumbnails should be consistently sized despite having sources of different dimensions, e.g. a Personnel page with a thumbnail for each person, it is important that the implementation supports this.
Apart from that, for extensibility and readability, it would be better to create a new component for this feature, rather than overloading the current
<pic>component.Proposed change: Implement the circle cutout feature as a new Vue component
<thumb>which is a square crop by default, with an optional attribute to change it to a circle, and only supports one dimensional attributesize, which controls the side length for squares, or diameter for circles.