Releases: bumptech/glide
Glide 4.4.0
This is the November release of Glide.
Features
- Updated Glide's generated API to allow RequestOptions return values and avoid a bunch of
@CheckResult
warnings (e78f2ee, 7fccb32) - Enabled cache sizes >
Integer.MAX_VALUE
(d402780, thanks to @bhargavms) - Added an API to
ViewTarget
calledclearOnDetach()
that allows you to optionally clear and restart requests when the corresponding view is detached and reattached to its window (#2520, d0fd967):Glide.with(fragment) .load(url) .into(imageView) .clearOnDetach();
- Added an API to
ViewTarget
calledwaitForLayout()
that simplifies the previous mechanism for forcing Glide'sViewTargets
to wait for a layout pass before determining the size of the view they wrap (05b8854):Glide.with(fragment) .load(url) .into(imageView) .waitForLayout();
- Added a MockGlideExecutor that could be used as part of a future testing compat library (6cee6d2, thanks to azlatin@)
- Added an API to specify a custom executor to use when decoding GIF frames (6837543)
Bugs
- Improved trimming behavior with inconsistent resource sizes (#2550, thanks to @unverbraucht)
- Fixed overly aggressive escaping of some valid characters in http urls (#2583, 014bf44)
- Added a direct dependency on support-fragment in Glide's pom (#2547, c1c9be2)
- Fixed an issue where dereferencing a
Target
without clearing it would result in the loaded resource never being returned to Glide's memory cache (#2560, 0209662, 7e317c0) - Fixed an IllegalStateException when
RequestManagers
are memoized and then used to start a new load afteronDestroy
of the correspondingActivity
orFragment
(#2262, 8119837) - Fixed an NPE when using GifDrawables as thumbnails due to a bug that can fail to clear thumbnails in
onStop()
(#2555, 9c82c42) - Fixed a
SecurityException
on some devices when trying to register a connectivity receiver (#1417, 6bc908b) - Fixed a
SecurityException
on some devices when trying to obtain connectivity status (#1405, bcd6cc2) - Fixed a couple of cases where
GifDrawable
s could continue to animate afterclear()
oronStop()
(#1087, 3dad449, 9d87dea) - Improved decode times for GIF frames on earlier versions of ART and some lower end devices by up to 40% (#2471, e7a4942, fa2ebfe, 7c0cd63, 4db20db, 65e5506)
- Eliminated a few unnecessary object allocations in Glide's request path (b4d778b)
- Fixed an issue on some devices where
ExternalPreferredCacheDiskCacheFactory.java
might attempt (and fail) to use external storage if the external storage directory exists but isn't writable (#2641, 5580e51, thanks to @anpez) - Ensure that requests started with
onlyRetrieveFromCache
don't block on already running equivalent requests that aren't usingonlyRetrieveFromCache
(#2428, 108a062) - Fixed a couple of cases where calling
load(Bitmap)
orload(Drawable)
could cause Glide to re-use or recycle the givenBitmap
orDrawable
(cff4f2c). - Fixed a bug where the disk cache could become unusable until apps are restarted if the system clears the cache directory while the app is open and the app calls
DiskCache.clear()
(#2465, 16eaa9b). - Fix a crash attempting to log a recycled Bitmap's size in Glide's
BitmapPool
pre-filling APIs (#2574, 7387298) - Fixed an error log "Expected to receive an object of but instead got null" when restarting requests with thumbnails where the thumbnail previously completed after the full request (a1e3fa2)
- Fixed a compilation error when compiling with
kapt
and-Dkotlin.compiler.execution.strategy="in-process"
while using aGlideModule
with the@Excludes
annotation.
Behavior Changes
-
Resources loaded into Targets outside of Activity/Fragment lifecycles (ie with the Application Context) will be returned to Glide's caches via a
WeakReference
andReferenceQueue
if theTarget
s are dereferenced without being cleared. Previously dereferencing these Targets would simply allow the underlying resource to be garbage collected, which could lead to unexpected cache misses (#2560). Transient memory usage may increase for applications that regularly dereference Targets without clearing them as the resources are now re-captured instead of being immediately and unexpectedly garbage collected.To disable this behavior, in an AppGlideModule, call setIsActiveResourceRetentionAllowed:
@Override public void applyOptions(Context context, GlideBuilder builder) { builder.setIsActiveResourceRetentionAllowed(false); }
-
Glide.with(fragment).load()
andGlide.with(fragment).asDrawable().load()
now behave identically. PreviouslyGlide.with(fragment).asDrawable().load()
would apply some specific options based on the type of the model provided toload()
, butGlide.with(fragment).load()
would not. Now both behave identically (8613292). -
Calling
RequestBuilder.load(byte[])
will no longer override previously setDiskCacheStrategy
andskipMemoryCacheOptions
options (c7b7dfe).
Breaking Changes
- The
RequestManager.load(Object)
method has been augmented with the same type specific overloads that are available onRequestBuilder
. Unfortunately this may break some tests that mock the return value ofRequestManager.load()
. Typically those breakages can be resolved by casting:Or if you're passing inwhen(requestManager.load((Object) any())).thenReturn(requestBuilder);
null
as your model in your tests:Or if you have a specific type for your model:when(requestManager.load((Object) null)).thenReturn(requestBuilder);
Or if your test has a specific type, but your production code uses an Object:when(requestManager.load(any(Uri.class))).thenReturn(requestBuilder);
// In tests: String url = ... when(requestManager.load((Object) eq(url))).thenReturn(requestBuilder); // In prod code: Object url = ... requestManager.load(url).into(imageView);
Deprecations
- Deprecated void return values for
@GlideOption
and@GlideType
annotated methods (e78f2ee, 7fccb32) - Deprecated
DiskLruCacheWrapper.get()
in favor of a static factory method (1cfc4af) - Deprecated
setResizeExecutor()
inGlideBuilder
in favor ofsetSourceExecutor()
(6837543) - Deprecated
ArrayPool.put(Array, Class<Array>)
in favor ofArrayPool.put(Array)
(b4d778b) - Deprecated the constructor in
ViewTarget
that accepts a booleanwaitForLayout
parameter in favor of thewaitForLayout()
method onViewTarget
(05b8854).
Glide 4.3.1
This is a bug fix release of Glide 4.3.0.
Bugfixes
- Fix ghosting in animated GIFs with certain combinations of disposal settings and frames (c3d0530, #2521, thanks to @michaeimm)
- Fix a Bitmap re-use bug causing graphical errors, load failures and/or crashes when loading Drawables with a transformation applied that didn't actually change the image for the requested width and height.
(2371aa6) - Fix a race condition causing animated Drawables not to be started when loaded into Views from Glide's memory cache (aa2711b, #2541)
Glide 4.3.0
This is the October release of Glide.
Features
- Added a
DiskLruCacheFactory
implementation that falls back to the internal cache directory on devices where the external cache directory isn't available (#24, 56a4275, thanks to @anpez) - Added an
error
API to start a new load if the primary load fails.
See the docs page for usage. (b06b0cc), - Added support for decoding non-
Bitmap
Drawables
and for transforming most of those types ofDrawables
. AnimatedDrawables
may be loaded if they're supported by the framework or support library, but can't be transformed. Consider usingoptionalTransform
if you want to try to transform non-Bitmap
resources but don't want your loads to fail if transformations can't be applied. (#350, a0628b8, 7614e10, fc4a456, 90f1cc9) - Added a helper method to avoid nesting when applying multiple levels of thumbnails (bc1b25e)
- Pass the
Context
provided toGlide.with()
(either the actualContext
or theContext
of the givenFragment
orActivity
) into Glide's requests. As a result, Glide will use theTheme
of the providedContext
automatically. Callers can override the defaultTheme
with thetheme()
option (#1267, bbb25af). - Pass through exception messages to
RequestFutureTarget
.
Previously all load failures would throw anExecutionException
with a more or less useless generic error message and stack trace. Now theExceptionMessage
will contain the same failure message that you see logged with the Glide log tag. (65048a4) - Added support for passing
Bitmap
s andDrawable
s into.load()
(7663c21)
Bugs
- Added
@CheckResult
to most intermediate builder methods in Glide's various builder classes to avoid errors where developers ignore the results and end up ignoring the options they'd tried to apply (739cb35, 28e461e, thanks to @TWiStErRob) - Avoid a concurrency bug in the platform on more varieties of Moto Xs (1e2fb23)
- Fixed an integer overflow when upscaling images in
Downsampler
(#2459, c7383b2) - Fixed a couple of import style nits (6cd8289, thanks to @brettchabot)
- Added a separate executor to decode GIF frames on to avoid stuttering when scrolling through lists of GIFs that was caused by Glide's normal threads being blocked by I/O or decoding GIF headers (#899, c4db04e).
- Fixed corrupt images caused by the
RoundedCorners
transformation (#2472, 0b5d1bc). - Removed an inaccurate Precondition that obfuscated the reasons for load failures (#2462, 890454a)
- Avoid failing requests for Files types that can't be mmaped (cbe9f42, thanks to @pkorth).
- Fixed a crash performing network operations when using a
GlideExecutor
with a customUncaughtExceptionHandler
(#2508, e6e2aef, thanks to @stephanenicolas) - Fixed Glide's Futures from blocking forever if the Request or a custom component throws an unexpected exception (74fcad1)
- Avoid showing incorrect frames when pausing/restarting GIFs (#2526, 90b3b9f)
Build
- Fixed a bunch of warnings and compile time noise and cleaned up a variety of build files and versions (#2426, thanks to @TWiStErRob)
- Fixed duplicate class files in the compiler jar (#2452m, 7c09fc1)
Behavior Changes
- Include the presence or absence (but not equality of)
RequestListeners
when determining whether or not to ignore new Requests as part of an ongoing effort to avoid unnecessary restarts of in progress loads (#2270, 95caa05). - Default GIFs to using ARGB_8888 instead of RGB_565 and add an API to specify the preferred format for GIFs specifically. As a result both GIF quality and memory usage will increase. For details on configuring the format, see the javadocs (#2396, 6f91031).
Breaking Changes
GlideException
sgetRootCauses()
method will now return aList
ofThrowable
instead ofException
. Doing so allows us to better handle certain expectedError
s, likeOutOfMemoryException
that otherwise have to be caught by ourExecutor
and swallowed. This change was made as part of avoiding behavior in Glide's Futures that could cause them to block forever (74fcad1).
Glide 4.2.0
This is the September release of Glide.
Features
- Added support for replacing Glide's default
Encoders
(03f5bd4, #2349, thanks to @MistaGreen) - Added a more advanced way to control how/when requests are restarted when they have the same cache keys (b667cab, thanks to @Tolriq).
- Repackaged Glide's annotation processor dependencies to avoid build errors with the generated API caused by dependency conflicts (a0e388e, #2059, thanks to @TWiStErRob)
- Added a bucketing system when registering custom components to make choosing the order in which the components are called easier and more intuitive (da90633, thanks to asuszek@).
- Pass
Options
toResourceTranscoders
to allow customizing behavior (134870e, #2417). - Added an interface to allow reporting or uncaught exceptions on Glide's thread pools (a1cd3af, thanks to @stephanenicolas)
Bug fixes
- Fixed incorrect Bitmap pool sizes on some versions of Android (fe5289d, #2334, thanks to @SUPERCILEX)
- Fixed a resource leak when following redirects in Glide's default Http library (7f62597, 73a8054, #2352)
- Fixed a racy resource leak where
DataFetchers
were sometimes never closed (d482b8e) - Fixed load failures due to a simultaneous put exception in Glide's default disk cache (01f5a3d)
- Fixed Http load failures caused by unexpected characters in the user agent of some devices (3cd0685)
- Worked around an O specific ClassCastException in the OkHttp support library (a4af922)
- Fixed logic in
RequestFutureTarget
to better match theFuture
documentation (f033e9b) - Fixed a few rounding issues when downsampling and transforming images to eliminate hardware bitmap errors and wasteful allocations when decoded Bitmaps from
Downsampler
are ~1 pixel off of the size required byTransformations
(f5ba374, b1b024e, 4b5ccaa) - Fix
get(View)
failing to find non-supportFragments
(a0c5af1) - Add better null handling to
ListPreloader
(c3479c4, #2379) - Fixed assertions when generated
GlideRequests
were used to load a model and then modified after the load was started (d56e08c). - Fixed load failures on some devices where UUIDs initialization is broken (d67ce32, #1510)
- Improved performance loading video frames slightly be avoiding duplicate
setDataSource
calls (a84deb3). - Handle all types of exceptions thrown by
ResourceDecoders
to allow other registeredResourceDecoders
to run even if one decoder fails or behaves unexpectedly (6cffaab). - Fixed an exception using
HARDWARE
Bitmaps with images where Glide is unable to determine the original dimensions (f9757a5). - Fixed an issue where sometimes the MediaStore thumbnail would be returned when
Target.SIZE_ORIGINAL
was used (4501396, thanks to asuszek@).
Documentation
- Added links to a Simplified Chinese translation of Glide's documentation page (ee557b6, thanks to @Muyangmin)
- Added Google's maven repo for support libraries to the setup example in the readme (3bf2d36, thanks to @rocboronat)
Behavior changes
- Calling
into()
orclear()
in aRequestListener
orTarget
implementation will now always crash with an assertion. Previously it would sometimes crash depending on how the request was configured. To avoid the exception, you can useHandler#post
to post yourinto()
orclear()
call to the main thread instead of calling it directly (6fb87b3, #2413) - Glide's interpretation of View sizes has changed substantially, see #2431 for more details.
- Changed the default downsample strategy to
CENTER_OUTSIDE
on KitKat+ for cases where neither a strategy nor a transformation that uses a strategy is applied to a load (8a90f54, thanks to asuszek@).
Glide 4.1.1
Glide 4.1.0
This is the August release of Glide.
Bug fixes
- Fixed a bug where options applied in
GlideExtensions
could be ignored if the extension option was applied to aRequestOptions
object that hadautoClone()
enabled (b39a9db) - Fixed an issue default options set in
RequestManager
could be ignored ifautoClone()
was enabled (d717e83) - Fixed double logging parts of GlideExceptions (9d7b8d9)
- Fixed a bug where
DiskCacheStrategy.ALL
andDiskCachceStrategy.RESOURCE
when used while loading a GIF might lead to a partial or invalid cache file (1594655) - Fixed a concurrent modification exception in
ViewTarget
(cac7192) - Fixed an error attempting to load files more than
Integer.MAX_VALUE
in length (#2240, 8fac123) - Fixed an issue with using cross fades in RecyclerView (06aced3).
- Clarified nullability of properties in
DataFetcher
(#2203, thanks to @Tolriq)
Features
- Removed the BitmapPool by default from low ram devices on O+ and decreased the default BitmapPool size on O+ (bb5c391)
- Added support for
Bitmap.Config.HARDWARE
in Android O+.
See note below for behavior changes. (d83de42) - Expose the entry count to subclasses of
LruCache
(a2a695f, thanks to @loran) - Target Android API 26 (cea1cce)
- Added support for loading a contact thumbnail by phone number (#2233, thanks to @dstefanox)
- Added a method to
GlideBuilder
so users can set defaultTransitions
(#2182, 0b99260) - Added a method to set network timeouts for Glide's default networking library (3e5527e)
- Automatically register Glide for
ComponentCallbacks
andComponentCallbacks2
so applications no longer have to do so manually (6b137c2) - Avoid restarting in progress or completed requests if the new request is identical to the old one (9d10097, 73a8e01, 0a44cf6, thanks to @Tolriq)
- Added a new shortcut method for applying multiple transformations (#2138, thanks to @realdeadfish)
Build changes
- Updated to Gradle 4.1 (0310656, thanks to @jaredsburrows)
API/Behavior changes:
- After 9d10097, if you attempt to start a request that is exactly the same as the request already in progress for a given
View
orTarget
, your new request will be ignored and the old request will be allowed to complete. If you need to override this behavior, you can do so by manually callingclear()
on theView
orTarget
before starting your new load. Consider filing an issue if you encounter a problem with this feature. - After 06aced3, Glide will always use a
TransitionDrawable
to run the cross fade transition. Previously cross fade would use aViewAnimation
for the first image in a request to complete and only useTransitionDrawables
for animating from thumbnails to full images. RecyclerView does not handleViewAnimations
run outside of its item animator so we've removed the use ofViewAnimation
. As a result, if you use views likeCircularImageView
that can't handle animatedDrawables
, you may see a change in behavior. Consider using aViewAnimation
basedTransition
instead of a cross fade if you're not loading in aRecyclerView
or file a new issue if you encounter a situation where neither cross fade nor aViewAnimation
will work. - After d83de42, setting
DecodeFormat.ARGB_8888
orDecodeFormat.RGB_565
will cause Glide to attempt to decode Bitmaps usingBitmap.Config.HARDWARE
. Hardware Bitmaps are more memory efficient, but can't be drawn in software and don't expose their pixels so methods likegetPixel()
will throw an exception, as will attempting to draw a hardware bitmap to aCanvas
. You can avoid using Hardware Bitmaps for an individual request by callingRequestOptions#disallowHardwareConfig
. You can also disallow hardware configurations for your entire application by passing inRequestOptions
intoGlideBuilder
in yourAppGlideModule
.
Glide 4.0.0
This is the July release of Glide.
We're calling this release 4.0.0, which means it's the first stable release of Glide v4.
Bug fixes
- Fixed an error initializing the Glide singleton allowing callers in some cases to obtain a partially initialized object (6c56e38, thanks to @Codeintheory for fixing this in the v3 branch in #2061).
- Fixed an issue where requesting only identity encodings from some image backends caused those image backends to return compressed streams that were not transparently decoded by HttpUrlConnection, resulting in decoding failures (#2132)
- Updated some old documentation in
DataFetcher
(#2153, thanks to @Teovald) - Fixed an issue causing Glide to wait forever to obtain View sizes for Views that we're re-attached to windows without requiring a size change (#1981)
- Fixed a few typos in the Readme (#2191, thanks to @rmtheis)
- Fixed a crash in
DefaultConnectivityMonitorFactory
when Glide was called via an IPC from an application that had the ACCESS_NETWORK_STATE permission but in an application that did not have the ACCESS_NETWORK_STATE permission (#2121).
Glide 4.0.0 RC1
This is the June release of Glide.
Glide 4.0.0 RC1 is an incremental pre-release version of Glide 4.
Features
- Added support for VectorDrawables to the placeholder methods (#1946, thanks to @Teovald)
- Minimal support for additional Bitmap configurations in Android O (853c687, better support will be coming in the future)
Bug fixes
- Fixed a duplicate field error when using GlideExtensions (#1971)
- Fixed VisibleForTesting lint errors in Glide's generated code (#1977)
- Fixed a bug preventing us from falling back to the error Drawable for null models when the fallback drawable isn't specified (#1985)
- Fixed an NPE when obtaining a RequestManager for a View (
Glide.with(view)
, #1991) - Propagate HTTP exceptions from the OkHttp library so that they're accessible when requests fail (#1967)
- Fixed a race condition causing resource leaks (#1996)
- Fixed an NPE in MultiModelLoader (#2028)
- Fixed a broken null check (48d1f14, thanks mattq@)
- Fixed a bug preventing the placeholder Drawable from being shown for null models when both the fallback and the error Drawables are unspecified (41cc06c, thnaks to angelorhoit@)
- Fixed an IllegalStateException when pending requests were cancelled and restarted (243c28c)
Packaging
Glide 4.0.0 RC0
Changes
There are too many changes to list individually, but here's a few highlights:
- New documentation that users can contribute to by submitting pull requests to Glide's gh-pages branch.
- A new extensible generated API that allows you to easily customize Glide's fluent API by adding new types or custom option sets.
- Substantially simplified types for individual requests that ensure that options are consistently available and easy to use even if you're loading different types of resources.
- A variety of performance improvements, including a substantial reduction in garbage when downsampling images, a more intelligent default disk cache strategy, and improved performance when loading GIFs.
- Improved handling of View sizes and layouts, especially in RecyclerView.
Status
Glide 4.0 is used internally by a variety of teams at Google and the library is considered stable internally. I expect that there will be more external users who may uncover issues that haven't come up internally. As a result I'm releasing this as an RC. If we don't uncover significant issues with stability or in the API, I expect a non-RC release shortly.
Release schedule.
Glide has had a rather haphazard approach to releases in the past, largely because I maintain Glide mostly in my free time. Going forward we're going to try to provide regular releases:
- Releases will go out once a month, around the 15th (the exact date may vary a bit)
- Releases will be skipped only if no changes have been since the previous release.
- Releases may include breaking API changes without a major version change.
The third bullet point will help bridge the gap between how Glide is maintained inside and outside of Google and enable more regular releases.
Glide 3.8.0
Glide 3.8.0 is a minor feature/bugfix release.
Features
- Added
getTotalLoopCount
to GIFs (#1836, thanks to @toyama-sumio) - Added a method to turn off manifest parsing for applications that do not use integration libraries (#1754, thanks to @joshzana)
- Added support for contact Uris (#394, thanks to @R4md4c)
- Better handling of OOMs (#1057, thanks to @dmapr and @ihenchi)
Notable Bugfixes
- Fixed a variety of issues with GIF handling and decoding (thanks @TWiStErRob, @toyama-sumio, @osama and @kojilin)
For a complete list of changes, see v3.7.0...v3.8.0