Skip to content

Commit

Permalink
fix(common): fix formatting on oversized image error (#47188)
Browse files Browse the repository at this point in the history
This is a tiny commit to add newlines in the image
directive's "oversized image" error. Currently, the
rendered and intrinsic image sizes are printed
mid-line, which make them a little hard to read.
This commit puts them each on their own line.

PR Close #47188
  • Loading branch information
kara authored and alxhub committed Aug 22, 2022
1 parent 5163e3d commit 8abf1c8
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -628,10 +628,11 @@ function assertNoImageDistortion(
RuntimeErrorCode.OVERSIZED_IMAGE,
`${imgDirectiveDetails(dir.rawSrc)} the intrinsic image is significantly ` +
`larger than necessary. ` +
`Rendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +
`Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +
`Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` +
`Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +
`\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +
`\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +
`\nRecommended intrinsic image size: ${recommendedWidth}w x ${
recommendedHeight}h. ` +
`\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +
`${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` +
`or consider using the "rawSrcset" and "sizes" attributes.`));
}
Expand Down

0 comments on commit 8abf1c8

Please sign in to comment.