{"record":{"id":"6c2b5ed3aa9a75fd","repo":"bumptech/glide","slug":"sizemultiplier-must-be-between-0-and-1","errorCode":null,"errorMessage":"sizeMultiplier must be between 0 and 1","messagePattern":"sizeMultiplier must be between 0 and 1","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/com/bumptech/glide/RequestBuilder.java","lineNumber":514,"sourceCode":"   *     javadoc on {@link #listener(RequestListener)} for one concrete example of the behavior\n   *     differences and complexity introduced by this method. Better consistency and readability\n   *     can be obtained by calling {@link #thumbnail(RequestBuilder)} with a duplicate {@code\n   *     RequestBuilder} on which you have called {@link BaseRequestOptions#sizeMultiplier(float)}.\n   *     In practice this method also isn't especially useful. It's much more common to want to\n   *     specify a number of different attributes for thumbnails than just a simple percentage\n   *     modifier on the target size, so there's little justification for keeping this method. This\n   *     method will be removed in a future version of Glide.\n   */\n  @NonNull\n  @CheckResult\n  @SuppressWarnings(\"unchecked\")\n  @Deprecated\n  public RequestBuilder<TranscodeType> thumbnail(float sizeMultiplier) {\n    if (isAutoCloneEnabled()) {\n      return clone().thumbnail(sizeMultiplier);\n    }\n    if (sizeMultiplier < 0f || sizeMultiplier > 1f) {\n      throw new IllegalArgumentException(\"sizeMultiplier must be between 0 and 1\");\n    }\n    this.thumbSizeMultiplier = sizeMultiplier;\n\n    return selfOrThrowIfLocked();\n  }\n\n  /**\n   * Sets the specific model to load data for.\n   *\n   * @param model The model to load data for, or null.\n   * @return This request builder.\n   */\n  @NonNull\n  @CheckResult\n  @SuppressWarnings(\"unchecked\")\n  @Override\n  public RequestBuilder<TranscodeType> load(@Nullable Object model) {\n    return loadGeneric(model);","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/library/src/main/java/com/bumptech/glide/RequestBuilder.java#L496-L532","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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))"],"exampleFix":"// before\nGlide.with(this).load(url).thumbnail(50f).into(imageView);\n// after\nGlide.with(this).load(url).thumbnail(0.5f).into(imageView);","handlingStrategy":"validation","validationCode":"float safeMultiplier = Math.max(0f, Math.min(1f, rawMultiplier));\n// safeMultiplier is guaranteed in [0, 1]\nGlide.with(view).load(url).thumbnail(safeMultiplier).into(imageView);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["glide","thumbnail","validation","deprecated"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}