Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White background getting auto appended for avif image #5450

Open
rajeevranjan-TUL-LF opened this issue Sep 24, 2024 · 0 comments
Open

White background getting auto appended for avif image #5450

rajeevranjan-TUL-LF opened this issue Sep 24, 2024 · 0 comments

Comments

@rajeevranjan-TUL-LF
Copy link

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):

@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:

<FrameLayout xmlns:android="...

Stack trace / LogCat:

paste stack trace and/or log here
Screenshot 2024-09-24 at 5 13 25 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant