Try: Add a quality query param to optionally set jpeg quality to a low or medium value #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP: Note this has not been manually tested.
This a speculative attempt to add a
low
andmedium
quality option to mshots when saving out the JPEG image (I've selected50
and72
as values, but these could be changed).The use case here is for if we need to display a larger number of screenshots on a particular page, we might wish to use lower quality images at a higher resolution, to optimise image loading. Or, use a small, low quality image in an initial page load before swapping out for a higher quality image. The purpose here is to give us the flexibility to be able have images with smaller file sizes.
Changes proposed
Add a
quality
query param to the PHP to support setting amed
orlow
image quality on the requested JPEG image.To do
quality=med
param should give you a unique filename with the quality in the name of the file, and this should be a unique cache key, too (I think I've done this correctly, but this should be verified)