Use Quality Before a Smaller Canvas
For JPG and WebP, encoding quality is searched at the current dimensions. A proportional resolution reduction follows only when the allowed range cannot fit the target.
- Keeps the existing pixel count when a valid quality fits
- Preserves source proportions during needed downscaling
- Makes the measured result available for final acceptance