Imagegen image used in lightbox appears as raw data instead of an image?
I have a strange issue... all clues/help appreciated!
I have a mediapicker property on a page that selects an album in the media section, all images below are listed as thumbs (works nicely), and also shown as a larger version in a lightbox.
Link to the resized image:
Screenshot of the same image shown in the lightbox:
<xsl:param name="currentPage"/> <xsl:variable name="mediapickerproperty" select="$currentPage/imageLibrary"/> <!-- datatype property for the mediapicker --> <xsl:variable name="bigW" select="700"/> <!-- max width of lightbox popup image in pixels --> <xsl:variable name="bigH" select="700"/> <!-- max height of lightbox popup image in pixels --> <xsl:template match="/">
Don't know if it's causing this, but one thing you should be aware of, is the added whitespace you're getting in the href attribute - when you're assembling a value using "mixed content" (text and elements inside an element), as in this:
<xsl:attribute name="href"><!-- This is interpreted as significant whitespace
-->/umbraco/imageGen.aspx?image=<!-- This too!
--><xsl:value-of select="./umbracoFile"/><!--
-->&width=<!--
--><xsl:value-of select="$bigW"/><!--
-->&constrain=true
</xsl:attribute>
btw, thanks chriztian for the xslt tutorial :) (I didn't see your remark when i posted the reply above)
As for the solution in my case,
'type' : 'image' was not set in the fancybox declaration, and in this newer version of the script it doesn't assume it's an image if the url doesn't end on .jpg or something alike...
I had this exact problem but with colorbox. There is no way to declare file type in Colorbox so i did a quick-and-dirty-hack. I just added a query string that ended on .jpg at the end.
Imagegen image used in lightbox appears as raw data instead of an image?
I have a strange issue... all clues/help appreciated!
I have a mediapicker property on a page that selects an album in the media section, all images below are listed as thumbs (works nicely), and also shown as a larger version in a lightbox.
Link to the resized image:
Screenshot of the same image shown in the lightbox:
xslt code:
Woah! ASCII art :-)
Don't know if it's causing this, but one thing you should be aware of, is the added whitespace you're getting in the href attribute - when you're assembling a value using "mixed content" (text and elements inside an element), as in this:
Instead, you can do:
<xsl:attribute name="href"> <xsl:text>/umbraco/imageGen.aspx?image=</xsl:text> <xsl:value-of select="umbracoFile" /> <xsl:text>&width=</xsl:text> <xsl:value-of select="$bigW"/> <xsl:text>&constrain=true</xsl:text> </xsl:attribute>
<xsl:attribute name="href"> <xsl:value-of select="concat('/umbraco/imageGen.aspx?image=', umbracoFile, '&width=', $bigW, '&constrain=true')" /> </xsl:attribute>
Nevermind, got it, it's a bug in the newer version of FancyBox, 1.3.1 has issues with images not ending on .jpg
btw, thanks chriztian for the xslt tutorial :) (I didn't see your remark when i posted the reply above)
As for the solution in my case,
'type' : 'image' was not set in the fancybox declaration, and in this newer version of the script it doesn't assume it's an image if the url doesn't end on .jpg or something alike...
I had this exact problem but with colorbox. There is no way to declare file type in Colorbox so i did a quick-and-dirty-hack. I just added a query string that ended on .jpg at the end.
"&plzshowmethe=image.jpg"
dude johan i love you man
is working on a reply...