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

Bitmap transforms not working when to resulting bitmap in the background #5378

Open
jeffreydecker opened this issue Mar 6, 2024 · 0 comments

Comments

@jeffreydecker
Copy link

Glide Version: 4.12.0

Integration libraries: OkHttp 4.11.0

Device/Android Version: Galaxy S21 Ultra

Issue details / Repro steps / Use case background: I'm trying to load an image from a URL as a bitmap in the background and apply a MultiTransformation but the transformations don't get applied. This also is also the case for things like circle crop. I'm wondering if there is a way to get the transform to apply to the resulting bitmap or if I'm going to have to find another approach.

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

    fun getBlurredImage(imageUrl: String?): Bitmap = 
       Glide.with(context)
                  .asBitmap()
                  .load(imageUrl)
                  .apply(RequestOptions.bitmapTransform(createBlurTransformation(context)))
                  .submit()
                  .get()

    private fun createBlurTransformation(context: Context) = MultiTransformation(
        ColorFilterTransformation(ContextCompat.getColor(context, R.color.opac_b_9)),
        BlurTransformation(BLUR_TRANSFORMATION_BLUR_RADIUS, BLUR_TRANSFORMATION_SAMPLING),
    )
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