wasabeef / glide-transformations

An Android transformation library providing a variety of image transformations for Glide.
Apache License 2.0
9.9k stars 1.41k forks source link

RoundedCornersTransformation not working in Adapter with CenterCrop #151

Open RaymanMartin opened 5 years ago

RaymanMartin commented 5 years ago

I try to use RoundedCornersTransformation to cut the bitmap in Adapter. But its not working good with Glide CenterCrop. and i also saw some issue like this. then i change the usage like this.but it's also not good working

heres the code i used in Adapter Glide.with(mContext) .load(avatar) .placeholder(R.drawable.ic_user_default_avatar) .error(R.drawable.ic_user_default_avatar) .transform(new CenterCrop(mContext), new RoundedCornersTransformation(mContext, 4, 0)) .into(ivAvatar);

btw.why the newest dependency library is use Glide 4.x , those i copy the RoundedCornersTransformation source code to my project.

My situation is: while i remove the RoundedCornersTransformation. The CenterCrop is work good. while i remove the CenterCrop.but the RoundedCornersTransformation is still not working.

Is there's some solutions to fix this problem?

joernahrens commented 5 years ago

I just have the same problem after moving to AndroidX. Currently using these versions: glide 4.9.0 glide-transformations 4.0.1

tranquoctrungcntt commented 5 years ago

i am facing the same problem

tranquoctrungcntt commented 5 years ago

anyone who is facing the same problem, please vote for @RaymanMartin.

M2dL1fe commented 5 years ago

i am facing the same problem

iamnicholasyeung commented 5 years ago

i am facing the same problem too.

etenel commented 5 years ago

i am facing the same problem too.

RoundedCornersTransformation extends BitmapTransformation ,in glide4.9,BitmapTransformation remove context in constructor. I copy and modify RoundedCornersTransformation constructor. it is normal, transform(new CenterCrop(),new RoundedCornersTransformation (5, 0, RoundedCornersTransformation .CornerType.LEFT)).

yuzhentao commented 4 years ago

GlideApp .with(context) .load(url) .transform(new CenterCrop(), new RoundedCornersTransformation(6, 0)) .into(iv);

AndSync commented 4 years ago
 RequestOptions options = new RequestOptions().transform(new MultiTransformation<>(new CenterCrop(),
                new RoundedCornersTransformation(DisplayUtils.dp2px(10), 0)));
            Glide.with(context).load(url).apply(options).into(imageView);