Copied to clipboard

Flag this post as spam?

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


  • aaronb 97 posts 116 karma points
    Aug 10, 2009 @ 22:17
    aaronb
    0

    changing _thumb dimensions in runway gallery?

    I've been using the runway gallery and after a few tweaks, it's been working nicely. I have one question though:

    I wanted to change the size of the thumbnails it uses. it appends _thumb to the image and generates what appears to be a fixed size thumbnail, I can't see anywhere to change it.

    I modified the macro using imagegen to create larger thumbnails, but the performance is much slower than when it uses the _thumb command.

    I did find a post on entering values in the upload data type, but I don't see how you go about referencing them from the xslt (if that's even the right place to be looking).

    Any suggestions on what I might try?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 10, 2009 @ 22:47
    Douglas Robar
    0

    There used to be a way to specify the size of the _thumb but I don't recall it off the top of my head. I'll see if I can dig it up and if it still works.

    As for ImageGen... you should find the performance is the same as for a static file, since all generated images are cached to disk. Only the first instance of creating the resized image should take any time, and that is usually very fast... though a slow or over-burdened server will take more time to generate the cached image. However, there is a caching bug in ImageGen 2.0.1 and you should grab the update at http://our.umbraco.org/projects/imagegen

    cheers,
    doug.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 10, 2009 @ 23:02
    Peter Dijksterhuis
    2

    Go to the developer-section and open data-types. Go and edit 'Upload'. You can define multiple dimensions for thumbnails there. Everytime you add a new image, a thumbnail with that dimension will be created as well.

    If you fill in 250, then _thumb_250 is appended to the name.

    HTH,

    Peter

    @Doug: it still works ;)

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 10, 2009 @ 23:06
    Dirk De Grave
    0

    And following Peter's post, max width/height of the thumb will be 250 depending on the image layout! If original pic is a 200x100 (hxw) portrait pic, then thumb_250 will have a 250x125 dimension. And the other way around for landscape pics.

     

    Cheers,

    /Dirk

  • aaronb 97 posts 116 karma points
    Aug 12, 2009 @ 21:51
    aaronb
    0

    thanks very much guys, all of that information is a huge help.

  • GDS_Bry 2 posts 22 karma points
    Dec 06, 2010 @ 12:05
    GDS_Bry
    0

    Sorry I know this is an old post but I just dont get it.

    When I go to DataTypes and edit Upload I can see the settings:

    Database datatype:  [ Nvarchar ]

    Thumnail sizes ( mas width/height, semicolon seperated for multi    [ input field ]

    How do I write the width and height in the input filed at Thumbnail sizes? I've tried to type in like 190, but nothing happens when I upload a new image. It still makes a thumbnail with the width 100px;

    Cant find anything in the XSLT file or in the CSS files. So how do I change this?

  • GDS_Bry 2 posts 22 karma points
    Dec 06, 2010 @ 14:52
    GDS_Bry
    0

    Ok so I got a Dokumenttype that I call Gallery Photo.
    Inside the dokumentype I got a property for the Image width and height, called umbracoWidth and umbracoHeight.

    Under developer section I got two XSLT files called: galleryListAlbums.xslt, galleryPhotos.xslt

    I guess it's the galleryPhotos.xslt I need to focus on, since thats where I find the umbracoHeight/Width values

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
    exclude-result-prefixes="msxml
    umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes
    Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings
    Exslt.ExsltSets ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:variable name="bigW" select="700"/>
    <xsl:variable name="bigH" select="700"/>


    <xsl:template match="/">

    <xsl:if test="$currentPage/galleryalbum &gt; 0">
    <xsl:variable name="images" select="umbraco.library:GetMedia($currentPage/galleryalbum, 1)" />
    <xsl:if test="count($images/*) &gt; 0">
    <xsl:for-each select="$images/*">
    <xsl:if test="./umbracoFile != ''">



    <a>
    <xsl:attribute name= "class">fancybox gallery</xsl:attribute>
    <xsl:attribute name= "rel">group</xsl:attribute>

    <xsl:choose>
    <xsl:when test="./umbracoWidth &lt; 700 and ./umbracoHeight &lt; 700">
    <xsl:attribute name= "href">
    <xsl:value-of select="./umbracoFile"/>
    </xsl:attribute>
    </xsl:when>
    <xsl:when test="./umbracoWidth &gt; ./umbracoHeight">
    <xsl:attribute name= "href">
    /umbraco/imageGen.aspx?image=<xsl:value-of select="./umbracoFile"/>&amp;width=<xsl:value-of select="$bigW"/>&amp;constrain=true
    </xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attribute name= "href">
    /umbraco/imageGen.aspx?image=<xsl:value-of select="./umbracoFile"/>&amp;height=<xsl:value-of select="$bigH"/>&amp;constrain=true
    </xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <img src="/umbraco/ImageGen.ashx?image={./umbracoFile}&amp;height=120&amp;pad=true&amp;bgcolor=white" alt="{./ImgDescription}" title="{./ImgDescription}"/>
    </a>
    </xsl:if>
    </xsl:for-each>
    </xsl:if>
    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

    So there must be a similar way to call the size of the generated thumbnails - added to the XSLT file, but where and how???

Please Sign in or register to post replies

Write your reply to:

Draft