Merged in feature/SW-3365-blurry-images (pull request #2746)
Feature/SW-3365 reduce upscaling of images (fix blurry images) * fix: handle when images are wider than 3:2 but rendered in a 3:2 container * use dimensions everywhere applicable * fall back to using <img sizes='auto' /> if possible * imageLoader: never nest * remove empty test file Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -11,6 +11,10 @@ type Image = {
|
||||
x: number
|
||||
y: number
|
||||
}
|
||||
dimensions?: {
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
meta: {
|
||||
alt?: string | null
|
||||
caption?: string | null
|
||||
@@ -36,6 +40,7 @@ export default function ImageContainer({
|
||||
width={600}
|
||||
alt={leftImage.meta.alt || leftImage.title}
|
||||
focalPoint={leftImage.focalPoint}
|
||||
dimensions={leftImage.dimensions}
|
||||
/>
|
||||
<Caption>{leftImage.meta.caption}</Caption>
|
||||
</article>
|
||||
@@ -47,8 +52,9 @@ export default function ImageContainer({
|
||||
width={600}
|
||||
alt={rightImage.meta.alt || rightImage.title}
|
||||
focalPoint={rightImage.focalPoint}
|
||||
dimensions={rightImage.dimensions}
|
||||
/>
|
||||
<Caption>{leftImage.meta.caption}</Caption>
|
||||
<Caption>{rightImage.meta.caption}</Caption>
|
||||
</article>
|
||||
</section>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user