-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PS AMP] Transparent images show the BBC blocks placeholder behind #8811
[PS AMP] Transparent images show the BBC blocks placeholder behind #8811
Comments
From investigating the issue, this bug affected both canonical and amp. I've created a PR for the canonical fix as this was simple. However the same fix can't be applied to amp, as the solution involved using To fix the amp side of this issue I have created two draft PR's, one which is quick and easy fix with a slight downside, and one that should be the correct way to do it, as it makes use of AMP's built in placeholder feature. #8837 - Quick and easy - This adds a background colour to the amp-image. However this means the BBC placeholder won't show while the image is loading. And if the amp image times out on the url it's loading from, it most likely will just show the coloured background and not the placeholder background. #8836 - More convoluted fix - The code for the draft PR has been done in Simorgh, however this should be implemented into |
This is a good investigation, Harvey. #8836 is the solution I would personally like to see. It makes use of native AMP behaviour and I think it would be worth investigating further to see if it can be made workable within Simorgh. |
#8914 Has been reverted due to the solution causing page weight to quadruple on Live for AMP pages. We need another solution or re-think how the fix in the PR should work. The main issue with the PR is that One solution might be adding the SVG as a static asset. However that would still mean the DOM might be too large due to it still having to render multiple placeholder/fallback amp images. Or we could go forward with the quick and hacky method outlined in this comment #8811 (comment) |
One thing to try harvey to assess where to bother going down the route of making the svg a static asset:
A small page weight increase may be acceptable to fix a bug, either that or we make a product decision to not support placeholders or go down your alternative route 🤷 ? |
Caught up to discuss this with Emily A. @andrewscfc @mukama @gavinspence
We've ruled out that we don't want to go down option 1 |
We're going to go with option 2 and use the colour fill (we have to fix this as these transparent images are widely used across PS) |
You may already have considered this, but jpgs cannot have transparency, and the vast majority of our images are jpgs. We could keep the placeholder on those, if preferred |
@ryanmccombe I'm not sure if that was consider tbh. Would it be a conditional placeholder based on the image file type then? I'm not sure if that's possible in AMP but if so it might be:
|
I've created a PR which incorporates Ryan's suggestion. It makes a lot of sense to do it that way instead of forcing a colour fill on every image type. I've implemented it so that it applies the colour fill on any image that's not a |
Describe the bug
A transparent image still hows the BBC blocks placeholder behind which means it can be seen through the image.
To Reproduce
Steps to reproduce the behaviour:
Doubts over UK's medium-term vaccine roll-out
Expected behaviour
Transparent images should not show the placeholder image behind it.
Screenshots

If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Testing notes
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: