Skip to content

Proposal: NextImage should automatically determine width/height for local images #18497

@Timer

Description

@Timer

Feature request

It'd be really cool if NextImage automatically configured width and height for local images, as well as automatically hashing the image.

Describe the solution you'd like

import Logo from "../logo.png";
import Image from "next/image";

// Logo = { src: '<basePath>/_next/media/logo-<hash>.png', width: 200, height: 150 }
<Image src={Logo} alt="Vercel" />

Describe alternatives you've considered

N/A

Additional context

Currently, you have to manually set the width and height for a local image. Plus, the image paths aren't statically verified like an import would be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions