glide icon indicating copy to clipboard operation
glide copied to clipboard

Imageview automatically zooming

Open thizisarun opened this issue 11 years ago • 8 comments

If i am setting image to imageview from path image view is automatically zooming, can you tell me why this happen? My code is

Glide.clear(imageView);
Glide.with(mContext)
    .load(path)
    .asBitmap()
//                .animate(R.anim.activity_fade_in)
//                .dontAnimate()
//                .centerCrop()
    .signature(new StringSignature(noteGroup.getLastModifiedDate().toString()))
    .placeholder(bitmapDrawable)
    .skipMemoryCache(false)
    .diskCacheStrategy(DiskCacheStrategy.SOURCE)
    .override(width, height)

thizisarun avatar Sep 28 '15 12:09 thizisarun

Possible duplicate of #363 if your placeholder is different aspect than your images. Also default anim: crossFade and default transformation: fitCenter (if you didn't say otherwise in XML).

TWiStErRob avatar Sep 28 '15 12:09 TWiStErRob

If i want to change placeholder size how can i achieve this?

thizisarun avatar Sep 28 '15 13:09 thizisarun

Change the drawable or at least its intrinsic size.

TWiStErRob avatar Sep 28 '15 13:09 TWiStErRob

If i am update same imageview old image is displayed at that time how can i clear?

thizisarun avatar Sep 28 '15 13:09 thizisarun

But you have a clear there. What is bitmapDrawable? If that's the previous image and you use it as a placeholder, the the load probably failed, because then it leaves the placeholder. Add a listener and log in both methods.

TWiStErRob avatar Sep 28 '15 13:09 TWiStErRob

"bitmapDrawable" is my own BitmapDrawable. I am getting bitmap from cache and then convert into drawable and set it.. If the bitmap is not available then i will set the custom drawable to placeholder

thizisarun avatar Sep 28 '15 13:09 thizisarun

Try with a listener to see what's going on.

Tip: In case that cache is Glide cache, you can also try .thumbnail() to do "I am getting bitmap from cache and then convert into drawable and set it.", because it accepts another Glide load.

TWiStErRob avatar Sep 28 '15 16:09 TWiStErRob

Let us know if you need further input, I'm definitely inclined to say this is a dupe of #363

sjudd avatar Sep 30 '15 16:09 sjudd