Hm, I've tried a few ways of writing image URLs and none seem to produce the desired result. What I would like to do is use ImageGen's AllowUpSizing feature, possibly turning it on and off from image URL. I'm working solely with XSLT.
While width is applied correctly, AllowUpsizing seems to be dropped. I also tried "allowupsize" as mentioned in one of Doug's forum posts, to no avail. Then I went on to define a class with AllowUpsizing=false in ImageGen.config (of course referencing ImageGen.config in web.config), and doing
I just tested it with ImageGen Professional 2.2 (that's the patch update to 2.0.1, available from the main ImageGen project page). Works great.
You need the Professional features enabled to control upsizing; the basic version always allows upsizing. Here's what you need to do:
Check that you have the professional features enabled by going to the /umbraco/imagegen.ashx?version url for your domain. If your domain isn't listed then you don't have the Pro features enabled with a proper registration key for the domain.
Temporarily set your imagegen.config file as follows (save the existing one): <ImageGenConfiguration> <Registration> <Key domain="xyz.com">43A419893417F18F468313561EBCE99C887463A</Key> </Registration>
Test the following urls. I've use the nocache=true to be sure you don't see the result of a previously-cached version but that's just for testing and not production. Change the image= parameter to an image on your site.
NO UPSIZING: /umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&nocache=true /umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&class=big&allowupsizing=false&nocache=true
Thanks for your explanation Doug, I was somehow convinced that the basic version allowed you to control upsizing too! Guess we need to look into getting a license then :-)
AllowUpSizing in URL?
Hm, I've tried a few ways of writing image URLs and none seem to produce the desired result. What I would like to do is use ImageGen's AllowUpSizing feature, possibly turning it on and off from image URL. I'm working solely with XSLT.
What I've got for now is as follows:
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
<xsl:value-of select="umbraco.library:GetMedia(data [@alias = 'Photo'], 'false')/data [@alias = 'umbracoFile']"/>
<![CDATA[&width=430&AllowUpsizing=false]]>
</xsl:attribute>
</img>
While width is applied correctly, AllowUpsizing seems to be dropped. I also tried "allowupsize" as mentioned in one of Doug's forum posts, to no avail. Then I went on to define a class with AllowUpsizing=false in ImageGen.config (of course referencing ImageGen.config in web.config), and doing
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
<xsl:value-of select="umbraco.library:GetMedia(data [@alias = 'Photo'], 'false')/data [@alias = 'umbracoFile']"/>
<![CDATA[&width=430&class=default]]>
</xsl:attribute>
</img>
But that didn't work either.
I've run out of ideas :-) Am I missing something obvious?
I just tested it with ImageGen Professional 2.2 (that's the patch update to 2.0.1, available from the main ImageGen project page). Works great.
You need the Professional features enabled to control upsizing; the basic version always allows upsizing. Here's what you need to do:
<ImageGenConfiguration>
<Registration>
<Key domain="xyz.com">43A419893417F18F468313561EBCE99C887463A</Key>
</Registration>
<Class Name="default" OverridesQueryString="false">
<AllowUpsizing>false</AllowUpsizing>
</Class>
<Class Name="big" OverridesQueryString="false">
<AllowUpsizing>true</AllowUpsizing>
</Class>
</ImageGenConfiguration>
NO UPSIZING:
/umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&nocache=true
/umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&class=big&allowupsizing=false&nocache=true
UPSIZING ALLOWED:
/umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&allowupsizing=true&nocache=true
/umbraco/imagegen.ashx?image=/css/img/gallery1.jpg&width=500&class=big&nocache=true
The docs explain the important details of the 'default' class and the OverridesQueryString setting in a class definition.
cheers,
doug.
Thanks for your explanation Doug, I was somehow convinced that the basic version allowed you to control upsizing too! Guess we need to look into getting a license then :-)
is working on a reply...