Skip to content

Implement image compressing to increase performance.#5

Merged
Tallented-Code-bot merged 1 commit into
mainfrom
compress-images
Jan 20, 2026
Merged

Implement image compressing to increase performance.#5
Tallented-Code-bot merged 1 commit into
mainfrom
compress-images

Conversation

@Tallented-Code-bot

Copy link
Copy Markdown
Collaborator

Increase performance with a svelte library to enhance images.

Copilot AI review requested due to automatic review settings January 20, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements image optimization by integrating @sveltejs/enhanced-img to automatically compress and serve responsive images, improving site performance.

Changes:

  • Added @sveltejs/enhanced-img package and configured the Vite plugin to enable image optimization
  • Converted static image imports to use the ?enhanced query parameter and replaced <img> tags with <enhanced:img> components
  • Removed unused image imports from the about page and updated CSS selectors to support the generated <picture> elements

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vite.config.ts Added enhancedImages() plugin before sveltekit plugin to enable image processing
src/routes/about/+page.svelte Converted two images to enhanced format, removed five unused imports, and updated CSS for picture elements
src/routes/+page.svelte Converted five images to enhanced format with appropriate sizes and fetchpriority attributes, updated CSS for picture elements
package.json Added @sveltejs/enhanced-img ^0.9.3 as a dev dependency
package-lock.json Locked dependencies for enhanced-img and its transitive dependencies including sharp image processing library

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/routes/+page.svelte
<article class="officer-entry">
<div class="officer-image">
<img src={carImage} alt="Wazzu Racing car" />
<enhanced:img src={carImage} alt="Wazzu Racing car" />

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enhanced:img component is missing a sizes attribute. The sizes attribute helps the browser determine which image resolution to load based on the viewport size, improving performance. Consider adding a sizes attribute similar to the other enhanced:img components in this file, for example: sizes="(min-width: 1200px) 600px, 50vw"

Suggested change
<enhanced:img src={carImage} alt="Wazzu Racing car" />
<enhanced:img
src={carImage}
alt="Wazzu Racing car"
sizes="(min-width: 1200px) 600px, 50vw"
/>

Copilot uses AI. Check for mistakes.
@Tallented-Code-bot
Tallented-Code-bot merged commit f76dc77 into main Jan 20, 2026
8 checks passed
@Tallented-Code-bot
Tallented-Code-bot deleted the compress-images branch January 20, 2026 19:59
@Tallented-Code-bot

Copy link
Copy Markdown
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

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