I am attempting to display an image in Next.js without specifying the width and height by using import Image from 'next/image';
.
It should be noted that the image is sourced from a URL, not a specific folder within the project.
<Image
sizes={"100vw"}
width={0}
height={0}
src={'https://picsum.photos/200/300'}
placeholder='empty' />
This code successfully displays images when imported from a folder, but encounters issues when trying to display an image from a URL.
Does anyone have any suggestions on how to render an image without specifying width and height properties?
Additionally, I would like to maintain the original size of the image rather than fitting it to the screen using the fill
and objectFit
properties.