Problem/Motivation
Follow-up to #3320689: Allow WebP quality to be configurable in GD2 image manipulation toolkit settings. In comment #71, @alexpott asked for a follow-up to add test coverage for image quality settings.
Also I note we don't have any actual test coverage that the quality configuration is resulting in changes to images. This is true for jpegs too. I think we should file a follow-up to add real test coverage that image quality settings are used and effective.
The GD toolkit has a jpeg_quality setting. #3320689: Allow WebP quality to be configurable in GD2 image manipulation toolkit settings adds webp.quality and webp.lossless. No tests currently check that these settings change the saved image. ToolkitSetupFormTest only checks that the form saves the config values.
Proposed resolution
Add kernel tests that save the same image with different quality settings. Assert that the saved files differ (for example in file size). Cover JPEG, WebP lossy and WebP lossless. The existing GdToolkit*ImageManipulationTest kernel tests in core/tests/Drupal/KernelTests/Core/Image do not set quality.
Remaining tasks
- Wait for #3320689: Allow WebP quality to be configurable in GD2 image manipulation toolkit settings to land for the WebP tests.
- Write the tests.
- Review.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Not needed.
Comments
Comment #2
joegraduate