Merged in feat/sw-3191-images (pull request #2670)

feat(images): SW-3191 slightly increase image width to improve quality

* feat(images): SW-3191 slightly increase image width to improve quality


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2025-08-19 06:54:25 +00:00
parent 78e3259317
commit 20d34198e3
2 changed files with 5 additions and 1 deletions

View File

@@ -22,6 +22,10 @@ function imageLoader({ quality, src, width }: ImageLoaderProps) {
const isAbsoluteUrl = src.startsWith('https://') || src.startsWith('http://')
const hasQS = src.indexOf('?') !== -1
if (width < 500) {
width += 150 // HACK! Slightly increase width for better quality
}
if (isAbsoluteUrl) {
return `https://img.scandichotels.com/.netlify/images?url=${src}&w=${width}${quality ? '&q=' + quality : ''}`
}