django-avatar
django-avatar copied to clipboard
change height width attribute value
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">
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%;}
Oh, I'm so sorry. I found the problem , I forgot to clear the broswer cache , So you are right !
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.
This is working as intended.