-
Notifications
You must be signed in to change notification settings - Fork 121
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
Show chequerboard only if there is transparency and during cropping too #3174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we can better do this with ng-class
bf704bb
to
55cc3ac
Compare
Seen on usage, media-api, kahuna, image-loader-projection, metadata-editor, leases (merged by @paperboyo 12 minutes and 58 seconds ago) Please check your changes! |
Seen on cropper, auth (merged by @paperboyo 13 minutes and 4 seconds ago) Please check your changes! |
Seen on collections (merged by @paperboyo 13 minutes and 8 seconds ago) Please check your changes! |
Seen on image-loader (merged by @paperboyo 27 minutes and 53 seconds ago) Please check your changes! |
Show chequerboard only if there is transparency and during cropping too
What does this change?
In the Viewer, this makes chequerboard not show up underneath images with no transparency. We’ve noticed that sometimes there was a brief flash of it, even though it immediately hid behind the image fully. It keeps the chequerboard for images with transparency.
We decide on transparency based on the existence of
optimisedPng
. This isn’t ideal, but we hidhasAlpha
under fileMetadata and we do not even have it there consistently for all images.optimisedPng
isn’t a perfect transparency synonym, but it should get better, and in any case, it won’t ever not be there if there is transparency (it may be there where there isn’t, but that’s OK as far as chequerboard is concerned).Lastly, this permanently overrides cropper.js CSS to always show the chequerboard behind the image. We haven’t noticed a flash of it for opaque images, so no transparency check is performed here. There is this cropper.js option, but I thought we would want our chequerboard look to be consistent.
How can success be measured?
These changes will make Viewer look less glitchy (no useless flashes of chequerboard) and will bring us closer to always presenting images with transparency on a chequerboard background (at the cropping stage). Thumbnail generation is the last place where we bake transparent images onto a background.
Screenshots
Viewer
[current on the left, proposed on the right]
Cropping stage
[current on the left, proposed on the right]
Tested?