Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dav 44 posts 69 karma points
    Nov 04, 2009 @ 16:52
    Dav
    0

    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?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 04, 2009 @ 18:58
    Douglas Robar
    0

    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:

    1. 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.

    2. Temporarily set your imagegen.config file as follows (save the existing one):
      <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>

    3. 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

      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.

  • Dav 44 posts 69 karma points
    Nov 05, 2009 @ 09:17
    Dav
    0

    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 :-)

Please Sign in or register to post replies

Write your reply to:

Draft