Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to retrieve the profile image with the _LThumb URL, in my people search result. But since my container is 30x30px, SharePoint is automatically retrieving the profile image with _MThumb on it. The image is a bit distorted this way and it is an issue on my clients end.

Is it possible to force the field to retrieve the image with LThumb URL so that the image will not be too distorted?

I have manipulated the XSLT of the search result and this is the field for the image:

<xsl:variable name="purl">
<xsl:call-template name="GetPicUrl">
<xsl:with-param name="PicUrl" select="pictureurl"/>
<xsl:with-param name="PlaceHolderUrl" select="'/_layouts/images/o14_person_placeholder_96.png'"/>
</xsl:call-template>
</xsl:variable>

Here is the template:

<xsl:template name="GetPicUrl">
  <xsl:param name="PicUrl"/>
  <xsl:param name="PlaceHolderUrl"/>
  <xsl:choose>
    <xsl:when test="string-length($PicUrl) &lt; 1 or starts-with($PicUrl, 'file:') or starts-with($PicUrl, '\\') or starts-with($PicUrl, '//')">
      <xsl:value-of select="$PlaceHolderUrl"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$PicUrl"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Also, Is it possible to retrieve the original image uploaded? Or a workaround so that during the upload it will also be saved? Can this be done without custom code?

Thank you in advance.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.