DownsampleStrategy
Indicates the algorithm to use when downsampling images.
DownsampleStrategy
does not provide any guarantees about output sizes. Behavior will differ depending on the com.bumptech.glide.load.ResourceDecoder using the strategy and the version of Android the code runs on. Use DownsampleStrategy
as an optimization to improve memory efficiency only. If you need a particular size or shape output, use an either instead or in addition to a
DownsampleStrategy
.
Some differences between versions of Android and s are listed below, but the list is not comprehensive because DownsampleStrategy only controls its output scale value, not how that output value is used.
On some versions of Android, precise scaling is not possible. In those cases, the strategies can only pick between downsampling to between 1x the requested size and 2x the requested size and between 0.5x the requested size and 1x the requested size because only power of two downsampling is supported. To preserve the potential for a com.bumptech.glide.load.Transformation to scale precisely without a loss in quality, all but AT_MOST will prefer to downsample to between 1x and 2x the requested size.