guardian / guardian/grid

Viewer doesn’t show checkered background for cutouts without `optimisedPng`

Open
#3,997 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.5k
Forks
121
Avg merge
4d 1h
Merged PRs (30d)
29

Description

## Short description
Because checkered background [depends on the presence](https://github.com/guardian/grid/blob/3113c1561338d3c3c8874b547b952a100f77ef7c/kahuna/public/js/image/view.html#L170) of `optimisedPng`, it won’t show for images with transparency which do not have one (eg. 8bit transparent PNGs).

## Steps to reproduce
Upload or find 8bit PNG with transparency (no `optimisedPng` in the API response, eg. 98e1b3a1464bb226d11d700c47268b1f8b1c2b30 in PROD).

## Actual results
Observe lack of checkerboard background for main image preview.

## Expected results
Checkerboard background should show for all images with transparency.

Contributor guide

Open the contributing guide

Research direction

Start in kahuna/public/js/image/view.html at the linked checkered-background condition around line 170, and inspect how the main image preview handles transparency without optimisedPng. Reproduce with the referenced 8bit transparent PNG asset and confirm that the checkerboard appears for transparent images even when the API response lacks optimisedPng.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.