Search

Now, I've done this so many times before, and never had this problem, so I'm super confused and annoyed by this.

I am splitting images using JIT, so that one can be used as a video poster image, and the other be the bottom of the image.

This is all depending on some logic to choose whether the image is big enough to split. The images are 990x557 pixels in dimension, and this is correctly reflected in the meta node for the image.

So, I am doing an xsl:choose to check the height, which for images hugely over the 557 mark, works. Images that are exactly 557 pixels in height are not doing anything at all.

<xsl:choose>
    <xsl:when test="$mode = 'case-study' and image/meta/@height &lt;= 557">

    </xsl:when>
    <xsl:when test="$mode = 'case-study' and image/meta/@height &gt; 557">

    </xsl:when>
</xsl:choose>

I've tried jiggling the sizes around by 1 or two pixels, but still no luck. The top when statement never returns, unless I stick a ridiculous value in there like 415

I'm going crazy here.

Ignore this, it turns out I was doing some maths wrong in another template. Tired sleepy eyes looking at code.

Just a quick thought: you could try and see if it works if you use &lt; 558 rather than&lt;= 557, in case the &lt;= is the problem.

Oh ok :)

The conditional logic is pretty straightforward. I don't see anything inherently wrong with it. What does your XML look like? Perhaps stick it in XPathr.com so the rest of us can take a stab.

Wow, I was really late on this one. You guys are fast.

It's the time difference Allen, that's all... ;o)

Just a sidenote: you could have used the otherwise tag, too.

That would save another value to update if you ever want to scale the images differently.

They're not the only when statements in the real choose there's more and an otherwise... But thanks!

I love the title of this post - so familiar. I felt immediately drawn to it :-)

It should be changed to

"Really annoying potato looking guy posts his silly maths mistakes online again"

potato looking guy

BTW: Will your old avator picture eventually come back?

Well, I had to remove the green hair. I re-bleached it, then got into some tv so chemical burned my scalp. Having a bit of hair free time to fix myself.

Maybe one day (when I hit a mid life crisis).

:-(

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details