bumptech / bumptech/glide

White background getting auto appended for avif image

Open
#5,450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
4d 1h
Merged PRs (30d)
8

Description

**Glide Version**:
implementation 'com.github.bumptech.glide:glide:4.16.0'

**Integration libraries**:
implementation 'com.github.bumptech.glide:avif-integration:4.14.2'

**Device/Android Version**:
Android 12 and higher

**Issue details / Repro steps / Use case background**:
white background getting appended in transparent images

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```java

@GlideModule
public class CustomAppGlideModule extends AppGlideModule {

@Override
public void applyOptions(Context context, GlideBuilder builder) {
builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_ARGB_8888).disallowHardwareConfig());
int bitmapPoolSizeBytes = 1024 * 1024 * 100;
builder.setBitmapPool(new LruBitmapPool(bitmapPoolSizeBytes));
builder.setDiskCache(new ExternalPreferredCacheDiskCacheFactory(context));
int memoryCacheSizeBytes = 1024 * 1024 * 100;
builder.setMemoryCache(new LruResourceCache(memoryCacheSizeBytes));
}

@Override
public boolean isManifestParsingEnabled() {
return false;
}
}

private LazyHeaders imageRequestHeader = new LazyHeaders.Builder()
.addHeader("accept", "image/webp,img/avif,image/*")
.build();

GlideRequests glideRequests = GlideApp.with(context.getApplicationContext());
RequestOptions requestOptions =
new RequestOptions().placeholder(ic_placeholder)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC).dontTransform();
glideRequests
.load(new GlideUrl(url, imageRequestHeader))
.skipMemoryCache(true)
.apply(requestOptions)
.into((ImageView) imageView).clearOnDetach();

```

**Layout XML**:
```xml

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue on Android 12 or higher with Glide 4.16.0, avif-integration 4.14.2, and the provided Glide load line. Confirm that a transparent AVIF image receives a white background; done means it displays with its transparency preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.