Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Can't get sorl.thumbnail to work

Received: by 10.236.154.170 with SMTP id h30mr8254889yhk.8.1337219040455;
        Wed, 16 May 2012 18:44:00 -0700 (PDT)
X-BeenThere: django-users@googlegroups.com
Received: by 10.236.128.9 with SMTP id e9ls1701052yhi.9.gmail; Wed, 16 May
 2012 18:43:35 -0700 (PDT)
Received: by 10.236.181.230 with SMTP id l66mr550519yhm.10.1337219015110;
        Wed, 16 May 2012 18:43:35 -0700 (PDT)
Date: Wed, 16 May 2012 18:43:34 -0700 (PDT)
From: Irfan Baig <ib...@ourgroup.org>
To: django-users@googlegroups.com
Message-ID: <33199705.2760.1337219014444.JavaMail.geo-discussion-forums@ynln6>
In-Reply-To: <7c8e119d-8602-4716-99e3-74c480668905@n42g2000yqm.googlegroups.com>
References: <7c8e119d-8602-4716-99e3-74c480668905@n42g2000yqm.googlegroups.com>
Subject: Re: Can't get sorl.thumbnail to work
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2758_6866793.1337219014442"

------=_Part_2758_6866793.1337219014442
Content-Type: multipart/alternative; 
	boundary="----=_Part_2759_16504659.1337219014442"

------=_Part_2759_16504659.1337219014442
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

    {% if profile.user.profile_pic %} 

>     {% thumbnail item.image "50x50" crop="center" as im %} 
>         <img src="{{ profile.profile_pic.url }}" 
> width="{{ im.width }}" height="{{ im.height }}"> 
>     {% endthumbnail %} 
>     {% endif %} 
>
>
Looks like you have a lot of mistakes in the variables you are referencing 
above. Your first {% if %} tag refers to profile.user.profile_pic, though 
I'm almost certain you want to reference profile.profile_pic.

Also, your thumbnail tag should look like this:
{% thumbnail profile.profile_pic "50x50" crop="center" as im %} 

Finally, since you are assigning the thumbnail to the im var, you'd want 
the image src to point to {{ im.url }}, not {{ profile.profile_pic_url }}. 

------=_Part_2759_16504659.1337219014442
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

&nbsp; &nbsp; {% if profile.user.profile_pic %}
<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">&nbsp; &nbsp; {% thumbnail item.image "50x50" crop="center" as im %}
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;img src="{{ profile.profile_pic.url }}"
<br>width="{{ im.width }}" height="{{ im.height }}"&gt;
<br>&nbsp; &nbsp; {% endthumbnail %}
<br>&nbsp; &nbsp; {% endif %}
<br>
<br></blockquote><br>Looks like you have a lot of mistakes in the variables you are referencing above. Your first {% if %} tag refers to profile.user.profile_pic, though I'm almost certain you want to reference profile.profile_pic.<br><br>Also, your thumbnail tag should look like this:<br>{% thumbnail profile.profile_pic "50x50" crop="center" as im %}
<br><br>Finally, since you are assigning the thumbnail to the im var, you'd want the image src to point to {{ im.url }}, not {{ profile.profile_pic_url }}. <br>
------=_Part_2759_16504659.1337219014442--

------=_Part_2758_6866793.1337219014442--