Image Usage
HP TV+ uses Next.js which recommended the usage of the Although Next.js recommends using its Image Component, HP TV+ prefers using the standard <img> tag for images.
Considerations
We need to consider the application breakpoint and that in some cases, the application should render a different image or the same image with a custom modification (crop, filling, …)
We need to consider that the current OVP implementation includes its own image proxy that handles quality and includes a low quality image as default and a template model to add custom width, height, quality and any other available usage params
Definition
So we have defined a way of working with such component following:
-
Img proxy using
-
qualityfor now 75 always but should be configurable per env so we can have better quality based on env -
widthbased on per breakpoint map into the biggest possible size for such breakpoint -
heightbased on a created ratio map applied to the breakpoint and the calculated width -
rs:fillwith the calculated visual width and height
-
-
placeholderwithbluras value -
blurDataURLas the default Image src from the OVP
We may end up having a different placeholder implementation based on designs, but it still worth to check the options for any extra case where its not considered