Skip to content

Add variant parameter to ImageProcessingChecker#11454

Open
patrickpatrickpatrick wants to merge 1 commit into
mainfrom
request-variant-image-processing
Open

Add variant parameter to ImageProcessingChecker#11454
patrickpatrickpatrick wants to merge 1 commit into
mainfrom
request-variant-image-processing

Conversation

@patrickpatrickpatrick
Copy link
Copy Markdown
Contributor

@patrickpatrickpatrick patrickpatrickpatrick commented May 15, 2026

What

Add variant parameter to ImageProcessingChecker.

Why

To prevent the incorrect variant of an image being used, you can now specify a variant in the ImageProcessingChecker so that the correct variant of an image will be rendered instead of the previous behaviour (the first non-original image).

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.

Follow these steps if you are doing a Rails upgrade.

@patrickpatrickpatrick patrickpatrickpatrick force-pushed the request-variant-image-processing branch 2 times, most recently from e83656c to 99326a6 Compare May 15, 2026 13:05
To prevent the incorrect variant of an image being used, you can now
specify a `variant` in the `ImageProcessingChecker` so that the correct
variant of an image will be rendered instead of the previous behaviour
(the first non-original image).
@patrickpatrickpatrick patrickpatrickpatrick force-pushed the request-variant-image-processing branch from 99326a6 to 240dfea Compare May 15, 2026 13:06
Copy link
Copy Markdown
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before & After screenshots would be good, just to demo the problem this was fixing.
But LGTM

// transformed variants so we should not use
// the `original` asset if this is the case
imgElement.src = previewAsset ? previewAsset.url : assets[0].url
imgElement.src = previewAsset.url
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the comment above this need deleting / editing now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants