Is it possible to keep Image Aspect in ImageGen 2.5.2? Am using am the basic version of ImageGen and when am displaying the images they are not very nice to look at even i want them as thumbnails with a specific width and height.
But somehow i would like to keep the Image Aspect as an Image Cropper would. Here is my XSLT when displaying images.
Yes, you'll need ImageGen Professional to use the &crop= feature. If you have any problems getting the parameters set to achieve what you want, just give a couple examples (with links) to what you're trying and we'll help you get it working just right.
By the way, in your xslt above you don't need to use ImageGen.ashx for the <a href=""> since you are just asking for the original image. You could simply use this instead:
I suspect that because you're UrlEncode'ing the path the browser isn't handling it properly.
In other words, the href="%2fmedia%2f3698%2ftam_extjour80_cr.jpg" rather than href="/media/3698/tam_extjour80_cr.jpg". Because there is no slash at the start the browser appends the href to the current url's path.
So, you could either stop UrlEncode'ing the umbracoFile:
Keeping aspect Ratio in ImageGen 2.5.2
Hi All,
Is it possible to keep Image Aspect in ImageGen 2.5.2? Am using am the basic version of ImageGen and when am displaying the images they are not very nice to look at even i want them as thumbnails with a specific width and height.
But somehow i would like to keep the Image Aspect as an Image Cropper would. Here is my XSLT when displaying images.
<xsl:param name="currentPage"/>
<xsl:variable name="photoGallery" select="number($currentPage/photoGallery)" />
<xsl:variable name="thumbWidth" select="number(110)" />
<xsl:variable name="thumbHeight" select="number(106)" />
<xsl:template match="/">
<!-- start writing XSLT --
<xsl:if test="number($photoGallery)">
<xsl:for-each select="umbraco.library:GetMedia($photoGallery, 'true')/Image">
<xsl:variable name="originalWidth" select="umbracoWidth"/>
<xsl:variable name="originalHeight" select="umbracoHeight"/>
<xsl:if test="umbracoFile !=''">
<a href="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&width={$originalWidth}&height={$originalHeight}" title="{@nodeName}" rel="gallery">
<img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&width={$thumbWidth}&height={$thumbHeight}&constrain=false&crop=resize" alt="{@nodeName}" title="{@nodeName}"/>
</a>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
constrain=false ==> constrain=true should do the trick :)
When i set Constrain = true, the thumbnails are not of the same size. So setting it to 'true' is not making any good for me.
Just to be sure: you do know that the crop=resize function needs a profesisonal Imagegen license?
I thought the Resize was part of the Basic Version. Just had a look at it http://www.percipientstudios.com/imagegen/features.aspx.
Ok i need to get buy the Pro Version to make thuis work then.
Hi, Fuji,
Yes, you'll need ImageGen Professional to use the &crop= feature. If you have any problems getting the parameters set to achieve what you want, just give a couple examples (with links) to what you're trying and we'll help you get it working just right.
By the way, in your xslt above you don't need to use ImageGen.ashx for the <a href=""> since you are just asking for the original image. You could simply use this instead:
<a href="{umbraco.library:UrlEncode(umbracoFile)}" width="{$originalWidth}" height="{$originalHeight}" title="{@nodeName}" rel="gallery">cheers,
doug.
Hi Doug,
I'll drop you an email with the examples of resize i want to achieve automatically using imagenGen.
Doug this is not working for me
What you have in your xslt file is the following:
<a href="img={umbraco.library:UrlEncode(umbracoFile)}" title="{@nodeName}" rel="gallery" width="{$originalWidth}"height="{$originalHeight}">You shouldn't have the img= in the href. It should be:
<a href="{umbraco.library:UrlEncode(umbracoFile)}" title="{@nodeName}" rel="gallery" width="{$originalWidth}"height="{$originalHeight}">Sorry Doug am using
<a href="{umbraco.library:UrlEncode(umbracoFile)}" title="{@nodeName}" rel="gallery" width="{$originalWidth}" height="{$originalHeight}">but not working.
I suspect that because you're UrlEncode'ing the path the browser isn't handling it properly.
In other words, the href="%2fmedia%2f3698%2ftam_extjour80_cr.jpg" rather than href="/media/3698/tam_extjour80_cr.jpg". Because there is no slash at the start the browser appends the href to the current url's path.
So, you could either stop UrlEncode'ing the umbracoFile:
<a href="{umbracoFile}" title="{@nodeName}" rel="gallery" width="{$originalWidth}" height="{$originalHeight}">Or, you could add a slash to the beginning of the href:
<a href="/{umbraco.library:UrlEncode(umbracoFile)}" title="{@nodeName}" rel="gallery" width="{$originalWidth}" height="{$originalHeight}">cheers,
doug.
I guess i'll just stick to which works.
<ahref="{umbracoFile}"title="{@nodeName}"rel="gallery"width="{$originalWidth}"height="{$originalHeight}">But thanks again.
Cheers,
Fuji
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.