Skip to content

Commit fff8056

Browse files
karaalxhub
authored andcommitted
fix(common): fix formatting on oversized image error (#47188) (#47232)
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
1 parent 0dd6102 commit fff8056

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,11 @@ function assertNoImageDistortion(
628628
RuntimeErrorCode.OVERSIZED_IMAGE,
629629
`${imgDirectiveDetails(dir.rawSrc)} the intrinsic image is significantly ` +
630630
`larger than necessary. ` +
631-
`Rendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +
632-
`Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +
633-
`Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` +
634-
`Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +
631+
`\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` +
632+
`\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` +
633+
`\nRecommended intrinsic image size: ${recommendedWidth}w x ${
634+
recommendedHeight}h. ` +
635+
`\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` +
635636
`${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` +
636637
`or consider using the "rawSrcset" and "sizes" attributes.`));
637638
}

0 commit comments

Comments
 (0)