Skip to content

Glide 5.0.10

Latest

Choose a tag to compare

@falhassen falhassen released this 16 Nov 21:59

Glide 5.0.10 & Compose / KTX 1.0.0-beta11 Release Notes

Includes all public changes since v5.0.9 (PR #5721, 2026-07-10).

Security

  • HttpUrlFetcher: Strip sensitive request headers (Authorization, Proxy-Authorization, Cookie, Cookie2) on cross-origin HTTP redirects by default when handling redirects manually. Can be configured via GlideBuilder.experimentalSetStripSensitiveHeadersOnCrossOriginRedirects(boolean).

Bug Fixes

  • GlideException: Prevent a NullPointerException (rethrown as CallbackException) in GlideException.printStackTrace() when logging a failed load whose cause list contains null.
  • UriBitmapImageDecoderResourceDecoder MIME & OS guards:
    • Reject non-image URIs (such as videos and GIFs) in UriBitmapImageDecoderResourceDecoder.handles() via a positive image/* MIME type check so non-image content URIs are not passed to ImageDecoder.
    • Restrict UriBitmapImageDecoderResourceDecoder to Android 15+ (API 35+) to avoid native container descriptor race conditions on older OS versions.
  • ImageDecoder decode fallback: Catch DecodeException and IOException in BitmapImageDecoderResourceDecoder.decode() and return null so DecodePath falls back cleanly to Downsampler and other registered decoders instead of failing the load.
  • Active resource release race (#5782): Add GlideBuilder.experimentalSetEnableActiveResourceReleaseRaceFix(boolean) so Engine.load() skips active resources whose reference count has already dropped to zero, preventing IllegalStateException: Cannot recycle a resource while it is still acquired.
  • RGB_565 allocation size (#4490, #4461): Add GlideBuilder.experimentalSetEnableRgb565DownsamplerFix(boolean) to fix allocating twice the required memory when downsampling RGB_565 bitmaps.
  • In-memory models passed via load(Object): Add GlideBuilder.experimentalSetUseTypedLoadForInMemoryObjects(boolean) so RequestBuilder.load(Object) delegates to the typed load(Bitmap), load(Drawable), and load(byte[]) overloads when the runtime model is one of those types, applying the expected default disk/memory cache strategies (e.g. from Compose GlideImage).

Features & Performance

  • Direct file-descriptor ImageDecoder support (Android 10+): Add ParcelFileDescriptorBitmapImageDecoderResourceDecoder and AssetFileDescriptorBitmapImageDecoderResourceDecoder behind GlideBuilder.setPrioritizeFileDescriptorOverInputStream(boolean) (used alongside setImageDecoderEnabledForBitmaps(true)), prioritizing ParcelFileDescriptor and AssetFileDescriptor ModelLoaders over InputStream ModelLoaders and decoding directly from file descriptors without buffering streams on the Java heap. Also allows frame(0) requests on still images to use ImageDecoder.
  • Stream fallback when ImageDecoder is enabled: Add GlideBuilder.setUseBitmapFactoryForInputStreamsWithImageDecoder(boolean) so InputStream sources decode incrementally via BitmapFactory (StreamBitmapDecoder) instead of buffering the entire stream into a contiguous ByteBuffer, avoiding OutOfMemoryError on large images while keeping ImageDecoder for in-place sources (File, ParcelFileDescriptor, AssetFileDescriptor, Uri, ByteBuffer).
  • EXIF orientation & minimum target size in ImageDecoder: Add GlideBuilder.setRespectExifOrientationInImageDecoder(boolean) to inspect EXIF orientation ahead of decode and select ALLOCATOR_SOFTWARE when rotation is required (avoiding hardware bitmap GPU readbacks), while clamping ImageDecoder.setTargetSize dimensions to at least 1px on extreme aspect ratios.
  • Fast-path URI extension check: Check file extensions from URI path segments in UriBitmapImageDecoderResourceDecoder.handles() before falling back to ContentResolver.getType(uri), avoiding synchronous Binder IPC for standard image URIs.
  • Bypass transformations for HARDWARE bitmaps: Add Downsampler.BYPASS_TRANSFORMATIONS_FOR_HARDWARE_BITMAPS (effective when Downsampler.ALLOW_HARDWARE_CONFIG is enabled) so display-only layouts where the target ImageView handles scaling/cropping can skip software-canvas bitmap transformations when the decoded resource is Bitmap.Config.HARDWARE.
  • Bypass resource disk cache for HARDWARE bitmaps: Add GlideBuilder.setBypassResourceDiskCacheForHardwareBitmaps(boolean) to skip compressing Bitmap.Config.HARDWARE resources into the resource disk cache, avoiding RenderThread GPU readbacks and transient software bitmap copies on decode threads.
  • Disk cache path-name memoization disabled by default: Disable eager File path-name memoization by default in DiskLruCacheWrapper / DiskLruCache to reduce retained heap memory for large disk caches.
  • Background memory trimming on TRIM_MEMORY_UI_HIDDEN: Add GlideBuilder.experimentalSetEnableTrimMemoryOnUiHidden(boolean) so setMemoryCategoryInBackground(MemoryCategory) also applies when the app transitions to ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN.
  • Unlimited source executor configuration: Add GlideBuilder.setSourceUnlimitedExecutor(GlideExecutor) and GlideExecutor.newUnlimitedSourceBuilder() to allow customizing UncaughtThrowableStrategy and thread pool parameters for unlimited source loads.

Integrations & Submodules

  • Compose (1.0.0-beta11):
    • Add GlideBuilder.experimentalSetClearGlidePainterOnStop(boolean) so GlidePainter clears active requests and releases Bitmap/Drawable references when the host LifecycleOwner moves below STARTED (ON_STOP), automatically restarting on ON_START.
    • Update required Java/JVM target version for :integration:compose to Java 11.
  • KTX (1.0.0-beta11):
    • Bump version to 1.0.0-beta11 alongside :integration:compose.
  • Cronet:
    • Add opt-in ChromiumUrlLoader.Options.Builder#setGuardActiveJobEviction(boolean) to verify job identity before evicting an active URL entry on asynchronous cancellation/completion callbacks.
    • Downgrade expected Cronet network request failure logs in ChromiumRequestSerializer from ERROR to WARN.
  • Concurrent (futures):
    • Replace restricted CallbackToFutureAdapter / AbstractResolvableFuture usage in GlideFutures with a custom AbstractFuture implementation, propagate synchronous submit() exceptions through the returned ListenableFuture, and drop the unused androidx.concurrent:concurrent-futures dependency.
  • DiskLruCache:
    • Add single-value convenience overloads DiskLruCache.open(directory, appVersion, maxSize) and Value.getFile(), and remove legacy multi-value entry complexity.

Internal Cleanup & Build / Dependency Updates

  • Narrow internal Engine, ActiveResources, Jobs, EngineJob, and EngineResource tracking keys from Key to EngineKey, standardize engine field ordering, remove unreachable pre-API 23 branches (minSdkVersion is 23), remove Util.setSdkVersionInt, fix Javadoc compilation warnings, clean up redundant @SuppressWarnings, and annotate builder/registry mutators with @CanIgnoreReturnValue.
  • Configure Renovate automergeType to pr and rebaseWhen to conflicted.
  • Dependency updates: Kotlin 2.4.20, KSP 2.3.14, Compose 1.12.1, androidx.appcompat 1.8.0, androidx.fragment 1.9.1, androidx.lifecycle 2.11.0, androidx.annotation 1.11.0, dagger 2.60.1, androidx.test:core 1.7.0, androidx.junit 1.3.0, androidx.espresso 3.7.0, androidx.benchmark 1.5.0-rc01, and com.google.truth 1.4.5.

Full Changelog: v5.0.9...v5.0.10