MCPcopy
hub / github.com/bumptech/glide

github.com/bumptech/glide @v5.0.7 sqlite

repository ↗ · DeepWiki ↗ · release v5.0.7 ↗
8,468 symbols 34,149 edges 696 files 1,712 documented · 20%
README

Glide

Maven Central | View Glide's documentation | 简体中文文档 | Report an issue with Glide

Glide is a fast and efficient open source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.

Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs. Glide includes a flexible API that allows developers to plug in to almost any network stack. By default Glide uses a custom HttpUrlConnection based stack, but also includes utility libraries plug in to Google's Volley project or Square's OkHttp library instead.

Glide's primary focus is on making scrolling any kind of a list of images as smooth and fast as possible, but Glide is also effective for almost any case where you need to fetch, resize, and display a remote image.

Download

For detailed instructions and requirements, see Glide's download and setup docs page.

You can download a jar from GitHub's releases page.

Or use Gradle:

repositories {
  google()
  mavenCentral()
}

dependencies {
  implementation 'com.github.bumptech.glide:glide:5.0.7'
}

Or Maven:

<dependency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>glide</artifactId>
  <version>5.0.5</version>
</dependency>

For info on using the bleeding edge, see the Snapshots docs page.

R8 / Proguard

The specific rules are already bundled into the aar which can be interpreted by R8 automatically

How do I use Glide?

Check out the documentation for pages on a variety of topics, and see the javadocs.

For Glide v3, see the wiki.

Simple use cases will look something like this:

// For a simple view:
@Override public void onCreate(Bundle savedInstanceState) {
  ...
  ImageView imageView = (ImageView) findViewById(R.id.my_image_view);

  Glide.with(this).load("https://goo.gl/gEgYUd").into(imageView);
}

// For a simple image list:
@Override public View getView(int position, View recycled, ViewGroup container) {
  final ImageView myImageView;
  if (recycled == null) {
    myImageView = (ImageView) inflater.inflate(R.layout.my_image_view, container, false);
  } else {
    myImageView = (ImageView) recycled;
  }

  String url = myUrls.get(position);

  Glide
    .with(myFragment)
    .load(url)
    .centerCrop()
    .placeholder(R.drawable.loading_spinner)
    .into(myImageView);

  return myImageView;
}

Status

Version 4 is now released and stable. Updates are released periodically with new features and bug fixes.

Comments/bugs/questions/pull requests are always welcome! Please read CONTRIBUTING.md on how to report issues.

Compatibility

  • Minimum Android SDK: Glide v4 requires a minimum API level of 14.
  • Compile Android SDK: Glide v4 requires you to compile against API 26 or later.

If you need to support older versions of Android, consider staying on Glide v3, which works on API 10, but is not actively maintained.

  • OkHttp 3.x: There is an optional dependency available called okhttp3-integration, see the docs page.
  • Volley: There is an optional dependency available called volley-integration, see the docs page.
  • Round Pictures: CircleImageView/CircularImageView/RoundedImageView are known to have issues with TransitionDrawable (.crossFade() with .thumbnail() or .placeholder()) and animated GIFs, use a BitmapTransformation (.circleCrop() will be available in v4) or .dontAnimate() to fix the issue.
  • Huge Images (maps, comic strips): Glide can load huge images by downsampling them, but does not support zooming and panning ImageViews as they require special resource optimizations (such as tiling) to work without OutOfMemoryErrors.

Build

Building Glide with gradle is fairly straight forward:

git clone https://github.com/bumptech/glide.git
cd glide
./gradlew jar

Note: Make sure your Android SDK has the Android Support Repository installed, and that your $ANDROID_HOME environment variable is pointing at the SDK or add a local.properties file in the root project with a sdk.dir=... line.

Samples

Follow the steps in the Build section to set up the project and then:

./gradlew :samples:flickr:run
./gradlew :samples:giphy:run
./gradlew :samples:svg:run
./gradlew :samples:contacturi:run

You may also find precompiled APKs on the releases page.

Development

Follow the steps in the Build section to setup the project and then edit the files however you wish. Android Studio cleanly imports both Glide's source and tests and is the recommended way to work with Glide.

To open the project in Android Studio:

  1. Go to File menu or the Welcome Screen
  2. Click on Open...
  3. Navigate to Glide's root directory.
  4. Select setting.gradle

For more details, see the Contributing docs page.

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else, email Glide's discussion group, or join our IRC channel: irc.freenode.net#glide-library.

Contributing

Before submitting pull requests, contributors must sign Google's individual contributor license agreement.

Thanks

Author

Sam Judd - @sjudd on GitHub, @samajudd on Twitter

License

BSD, part MIT and Apache 2.0. See the LICENSE file for details.

Disclaimer

This is not an official Google product.

Extension points exported contracts — how you extend this code

RequestOptionsFactory (Interface)
Creates a new instance of RequestOptions. [59 implementers]
library/src/main/java/com/bumptech/glide/Glide.java
VolleyRequestFactory (Interface)
Used to construct a custom Volley request, such as for authentication header decoration. [11 implementers]
integration/volley/src/main/java/com/bumptech/glide/integration/volley/VolleyRequestFactory.java
CompilationProvider (Interface)
Provides the Compilation used to compile test code. [24 implementers]
annotation/compiler/test/src/test/java/com/bumptech/glide/annotation/compiler/test/CompilationProvider.java
DataOpener (Interface)
Converts test resources into various useful data types for benchmarking. [7 implementers]
benchmark/src/androidTest/java/com/bumptech/glide/benchmark/data/DataOpener.java
BackgroundTester (Interface)
(no doc) [8 implementers]
library/test/src/test/java/com/bumptech/glide/tests/BackgroundUtil.java
Clock (Interface)
A simple wrapper for obtaining the current time for testing. While this interface exists in lots of libraries, espec [4 …
integration/sqljournaldiskcache/src/main/java/com/bumptech/glide/integration/sqljournaldiskcache/Clock.java
Query (Interface)
An interface representing a query in Flickr's API that returns a list of photos. [4 implementers]
samples/flickr/src/main/java/com/bumptech/glide/samples/flickr/api/Query.java
ResourceConsumer (Interface)
Acts on a resource loaded by Glide. @param The type of resource (Bitmap, Drawable etc). [3 implementers]
integration/concurrent/src/main/java/com/bumptech/glide/integration/concurrent/GlideFutures.java

Core symbols most depended-on inside this repo

get
called by 834
library/src/main/java/com/bumptech/glide/load/engine/Resource.java
load
called by 501
library/src/main/java/com/bumptech/glide/ModelTypes.java
build
called by 314
library/src/main/java/com/bumptech/glide/Glide.java
put
called by 283
library/src/main/java/com/bumptech/glide/load/engine/cache/DiskCache.java
with
called by 247
library/src/main/java/com/bumptech/glide/Glide.java
write
called by 214
library/src/main/java/com/bumptech/glide/load/engine/cache/DiskCache.java
submit
called by 209
integration/concurrent/src/main/java/com/bumptech/glide/integration/concurrent/GlideFutures.java
add
called by 183
library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java

Shape

Method 7,370
Class 954
Interface 125
Enum 19

Languages

Java100%

Modules by API surface

library/test/src/test/java/com/bumptech/glide/request/SingleRequestTest.java108 symbols
library/test/src/test/java/com/bumptech/glide/load/data/BufferedOutputStreamTest.java91 symbols
third_party/disklrucache/src/test/java/com/bumptech/glide/disklrucache/DiskLruCacheTest.java80 symbols
library/src/main/java/com/bumptech/glide/request/BaseRequestOptions.java79 symbols
library/test/src/test/java/com/bumptech/glide/GlideTest.java75 symbols
library/test/src/test/java/com/bumptech/glide/request/ErrorRequestCoordinatorTest.java73 symbols
library/test/src/test/java/com/bumptech/glide/load/engine/EngineTest.java65 symbols
annotation/compiler/test/src/test/resources/GlideExtensionWithOptionTest/GlideOptions.java65 symbols
annotation/compiler/test/src/test/resources/GlideExtensionOptionsTest/StaticMethodName/GlideOptions.java65 symbols
annotation/compiler/test/src/test/resources/GlideExtensionOptionsTest/MemoizeStaticMethod/GlideOptions.java65 symbols
library/test/src/test/java/com/bumptech/glide/request/RequestOptionsTest.java64 symbols
annotation/compiler/test/src/test/resources/GlideExtensionOptionsTest/SkipStaticMethod/GlideOptions.java64 symbols

For agents

$ claude mcp add glide \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact