bumptech/glide · error · IllegalArgumentException
sizeMultiplier must be between 0 and 1
Error message
sizeMultiplier must be between 0 and 1
What it means
The deprecated thumbnail(float sizeMultiplier) method on RequestBuilder validates that the float argument falls within the inclusive range [0, 1]. Values below 0 or above 1 have no meaningful interpretation as a fractional thumbnail dimension and are rejected with an IllegalArgumentException. This method is deprecated and slated for removal.
Source
Thrown at library/src/main/java/com/bumptech/glide/RequestBuilder.java:514
* javadoc on {@link #listener(RequestListener)} for one concrete example of the behavior
* differences and complexity introduced by this method. Better consistency and readability
* can be obtained by calling {@link #thumbnail(RequestBuilder)} with a duplicate {@code
* RequestBuilder} on which you have called {@link BaseRequestOptions#sizeMultiplier(float)}.
* In practice this method also isn't especially useful. It's much more common to want to
* specify a number of different attributes for thumbnails than just a simple percentage
* modifier on the target size, so there's little justification for keeping this method. This
* method will be removed in a future version of Glide.
*/
@NonNull
@CheckResult
@SuppressWarnings("unchecked")
@Deprecated
public RequestBuilder<TranscodeType> thumbnail(float sizeMultiplier) {
if (isAutoCloneEnabled()) {
return clone().thumbnail(sizeMultiplier);
}
if (sizeMultiplier < 0f || sizeMultiplier > 1f) {
throw new IllegalArgumentException("sizeMultiplier must be between 0 and 1");
}
this.thumbSizeMultiplier = sizeMultiplier;
return selfOrThrowIfLocked();
}
/**
* Sets the specific model to load data for.
*
* @param model The model to load data for, or null.
* @return This request builder.
*/
@NonNull
@CheckResult
@SuppressWarnings("unchecked")
@Override
public RequestBuilder<TranscodeType> load(@Nullable Object model) {
return loadGeneric(model);View on GitHub (pinned to eb14a895d8)
Solutions
- Ensure the multiplier is a fraction in [0,1]; if you have a percentage, divide by 100f before passing
- Prefer the non-deprecated thumbnail(RequestBuilder) overload or override() to control thumbnail size
- Clamp the value before calling: Math.max(0f, Math.min(1f, multiplier))
Example fix
// before Glide.with(this).load(url).thumbnail(50f).into(imageView); // after Glide.with(this).load(url).thumbnail(0.5f).into(imageView);
Defensive patterns
Strategy: validation
Validate before calling
float safeMultiplier = Math.max(0f, Math.min(1f, rawMultiplier)); // safeMultiplier is guaranteed in [0, 1] Glide.with(view).load(url).thumbnail(safeMultiplier).into(imageView);
Prevention
- Always clamp user-provided or computed multipliers to [0, 1] before passing to thumbnail(float)
- Prefer thumbnail(RequestBuilder) or override() for explicit size control
- Remember thumbnail(float) is deprecated — migrate away from it
When it happens
Trigger: Calling Glide.with(view).load(url).thumbnail(sizeMultiplier) where sizeMultiplier is a user-provided or computed float outside [0,1]. Passing a percentage as a whole number like 50f instead of 0.5f.
Common situations: Developers confusing percentage (0-100) with fraction (0-1). UI code that computes a multiplier from display metrics and passes an unchecked value. Legacy code migrating from a percentage-based API.
Related errors
- You cannot use a request as both the main request and a thum
- MultiTransformation must contain at least one Transformation
- Cannot add invalid orientation: {orientation}
- You cannot start a load on a fragment before it is attached
- Unable to find GlideModule implementation
AI-assisted analysis of bumptech/glide@eb14a895d8 (2026-08-14).
Data as JSON: /api/errors/6c2b5ed3aa9a75fd.
Report an issue: GitHub.