Skip to content

Commit

Permalink
fix(common): fix formatting on oversized image error (#47188) (#47232)
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

PR Close #47232
  • Loading branch information
kara authored and alxhub committed Aug 23, 2022
1 parent 0dd6102 commit fff8056
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
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 fff8056

Please sign in to comment.