django-avatar icon indicating copy to clipboard operation
django-avatar copied to clipboard

change height width attribute value

Open anuj9196 opened this issue 8 years ago • 3 comments

I'm using latest version of this plugin, it's an awesome plugin.

I want to display user avatar which if of 400x400 but img attribute's height and width property set to 100% or something other than 400 or get width and height attribute removed, like

<img src="image_path_of_400x400" class="img-responsive" alt="name" width="100%" height="100%">

OR 

<img src="image_path_of_400x400" class="img-responsive">

I tried

{% avatar user 400 class="img-responsive" width="100%" height="100%" %}

But it always prints

<img src="image_path_of_400x400" class="img-responsive" alt="name" width="400" height="400">

anuj9196 avatar Sep 14 '17 09:09 anuj9196

You shouldn't use width and height in this manner. If you are going to use avatar images and need to set height and width. I suggest you utilize a CSS and the class name.

Also, this is acting as intended.

You are specifying user 400 which tells it to set the width and height to 400.

{% avatar user 400 class="img-responsive" width="100%" height="100%" %}

I suggest you use something like this.

HTML file {% avatar user class="img-responsive avatar" %}

CSS .Img-responsive.avatar { height: 100%; width: 100%;}

TerminalFi avatar Jun 23 '18 19:06 TerminalFi

Oh, I'm so sorry. I found the problem , I forgot to clear the broswer cache , So you are right !

954-Ivory avatar Jul 22 '18 16:07 954-Ivory

If I set the image's width and height properties to be larger that than the default which is 80px, a blurry version of the image is rendered.

aklson-datascientist avatar Jan 05 '21 18:01 aklson-datascientist

This is working as intended.

johanneswilm avatar Aug 16 '22 10:08 johanneswilm