question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

next/image resize not working as expected

See original GitHub issue

Bug report

Describe the bug

First of all thanks for all the efforts building up to the 10.0.0 release! 💪

I’ve been experimenting with the next/image <Image /> component to do some auto optimisations for the images on my blog. Unfortunately I quickly ran into some resizing issues. When I resize my viewport to be smaller than the image I would expect the image to resize automatically to a smaller variation but it doesn’t.

To Reproduce

Unsure how to reproduce since it might be user error. I’m experimenting with some basic examples like:

<Image src="/avatar.png" alt="avatar" height={500} width={500} />

Expected behavior

I would expect the image to automatically resize to fit the viewport.

Screenshots

See a rather extreme example below.

Screenshot 2020-10-29 at 16 37 57 Screenshot 2020-10-29 at 16 38 09

System information

  • OS: macOS
  • Browser (if applies): chrome
  • Version of Next.js: 10.0.0
  • Version of Node.js: 14.5.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

12reactions
Timercommented, Oct 29, 2020

We’re currently working on adding a layout="responsive" prop you can pass to NextImage! We’ll have it on canary for you to try soon!

3reactions
Chukwu3mekacommented, Jan 4, 2021

any way to make height 100% in responsive

Read more comments on GitHub >

github_iconTop Results From Across the Web

why next/image is not resizing images after release only locally?
And when we deploy our app to our domain it looks like resizing is not working anymore and next image is loading full...
Read more >
next/image - Next.js
When the browser chooses, it does not yet know the size of the image on the page, so it selects an image that...
Read more >
Next.js automatic image optimization with next/image
Learn about automatic image optimization and how it can benefit developers with the native, game-changing, and powerful next/image API.
Read more >
All you need to know about images in Next.js - DatoCMS
Responsiveness: images will be resized according to the device used. Visual stability: the cumulative layout shift problem is automatically ...
Read more >
Resizing or Scaling -- IM v6 Examples - ImageMagick
That is the image will not be squashed or squeezed, only resized, unless you tell it otherwise. ... and thus allowing linear operations...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found