You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
your code can work ok。
my code is:
Glide.with(context)
.load(realUrl)
.centerCrop()
.placeholder(R.drawable.default_avatar)
.error(R.drawable.default_avatar)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.bitmapTransform(new RoundedCornersTransformation(context,8,0))
.into(imageView);
Check the code of centerCrop/fitCenter/dontTransfrom/bitmapTransform they all call transform. To combine two transformations you need to use the varargs version and forget about the convenience methods:
OK I was able to make it work by tweaking RoundedCornersTransformation. In the transform() method, you should use outWidth and outHeight instead of the source bitmap width/height
Sorry, I was wrong about .transform(...) I always forget that @wasabeef's transformations are Transformation<Bitmap> and not BitmapTransformation, using .bitmapTransform(...) works as expected, see #40 (comment).
Activity
wasabeef commentedon Sep 16, 2015
@leixinstar
Please tell me your source code.
the following code is sample.
leixinstar commentedon Sep 21, 2015
your code can work ok。
my code is:
Glide.with(context)
.load(realUrl)
.centerCrop()
.placeholder(R.drawable.default_avatar)
.error(R.drawable.default_avatar)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.bitmapTransform(new RoundedCornersTransformation(context,8,0))
.into(imageView);
squeeish commentedon Sep 25, 2015
@wasabeef from what I understand, we cannot use Glide's centerCrop() if we use bitmapTransform?
wasabeef commentedon Sep 25, 2015
@leixinstar
@squeeish
Yeah..
It can't be used
centerCrop
if you use thebitmapTransform
leixinstar commentedon Oct 9, 2015
RoundedCornersTransformation and CropTransformation(mContext, 300, 100, CropTransformation.CropType.TOP),how can this two work together?
balavishnu commentedon Nov 24, 2015
Removing centerCrop fixed the issue for me. Thanks
TWiStErRob commentedon Mar 8, 2016
Check the code of
centerCrop
/fitCenter
/dontTransfrom
/bitmapTransform
they all calltransform
. To combine two transformations you need to use the varargs version and forget about the convenience methods:@wasabeef I think you should update https://github.com/wasabeef/glide-transformations#advanced-step-3 with the information that
.centerCrop()
in a combined usage becomesnew CenterCrop(context)
(similar forfitCenter
.felipecsl commentedon May 10, 2016
@TWiStErRob that doesn't work either, same results
felipecsl commentedon May 10, 2016
OK I was able to make it work by tweaking
RoundedCornersTransformation
. In thetransform()
method, you should useoutWidth
andoutHeight
instead of the source bitmap width/heightFixes RoundedCornersTransformation width/height
TWiStErRob commentedon May 11, 2016
Sorry, I was wrong about
.transform(...)
I always forget that @wasabeef's transformations areTransformation<Bitmap>
and notBitmapTransformation
, using.bitmapTransform(...)
works as expected, see #40 (comment).qibin0506 commentedon Jul 6, 2016
In Adapter, sometime it is ok, but sometime, not, my code :
7 remaining items