Skip to content

Optimize image usage on homepage#22

Open
cramforce wants to merge 1 commit into
RexanWONG:mainfrom
cramforce:malte/image-optimization
Open

Optimize image usage on homepage#22
cramforce wants to merge 1 commit into
RexanWONG:mainfrom
cramforce:malte/image-optimization

Conversation

@cramforce

@cramforce cramforce commented Nov 11, 2024

Copy link
Copy Markdown

Uses the new getImageProps function in next/image to provide srcset data to the motion.img component that is being used on the homepage.

I expected this to reduce bandwidth usage on the homepage by 80% to 90% since it currently loads very large PNG images.

This PR is untested since I don't have secrets to run the app.

Uses the new `getImageProps` function in `next/image` to provide `srcset` data to the `motion.img` component that is being used on the homepage.

This PR is untested since I don't have secrets to run the app.
@vercel

vercel Bot commented Nov 11, 2024

Copy link
Copy Markdown

@cramforce is attempting to deploy a commit to the rexanwong's projects Team on Vercel.

A member of the Team first needs to authorize it.

@MatinAniss

MatinAniss commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

getImageProps requires width and height or else it will throw a runtime error.
This is also less desirable compared to just using the next image component, which does more than just providing srcset to a img element.
This PR does this #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants