Open rutgerbakker95 opened 3 years ago
I am also seeing this on the nuxt3 version of the plugin.
Same here. Any solution for this?
See code.
It looks like fill
incorrectly gets mapped to scale
.
If you want it to be fill
instead use fit="contain"
, as contain is mapped to fill.
fill
: Resize the image to the specified dimensions, cropping the image if needed.scale
: Resize the image to the specified dimensions, changing the original aspect ratio if needed.The issue here is that the Nuxt Image definitions for 'contain' and 'fill' are somewhat different.
The fit property specifies the size of the images. There are five standard values you can use with this property.
- cover: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit
- contain: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary.
- fill: Ignore the aspect ratio of the input and stretch to both provided dimensions.
- inside: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.
- outside: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.
Effectively Contentful's 'fill' is the same as Nuxt Image's 'cover', as far as I can tell.
Hi,
When I'm using Contentful provider and change the
fit
prop. It renders the property incorrect:"@nuxt/image": "^0.6.0",
Example
This component..
renders:
<img src="...?w=500&h=500&fit=fill" width="500" height="500">
When I try to use
fit='fill'
it rendersscale