fix/correct-image-size-selection

Open
#629 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
css, html, next.js, typescript

Research direction

Start by examining the event page cover images and the CSS containers that determine their displayed widths; the issue does not name specific files or tests. Compare the sizes passed to images with their rendered widths, then determine an approach that avoids undersized image resolutions while accounting for the lazy-loading tradeoff of sizes="auto". Done when images load at an appropriate resolution for their displayed size.

Written by the indexing model from the issue text.

Description

bug
Image

Annoyingly, image size selection is not quite fixed yet. In some places where the passed image size is different than the actually displayed image size image resolutions that are too small are choosen. For example on my computer (the image above) the event page's cover images are specified as 240 px wide, however the image itself is inside a container with width 100% so the actual size of the image becomes 400 pixels, not 240 pixels.

A solution is to use sizes="auto", this allows the browser to load the correctly sized image automatically after figuring out the CSS layout. However, the downside is that this makes the image load lazily.

Another solution is to go over the css and pass the proper sizes to the images. However, percentages cannot be used as sizes so one will need to figure out a way to get proper length values.

Dominant language
TypeScript
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vevcom/project-next

All issues in vevcom/project-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.