Select to view content in your preferred language

Feature report: conditional query, check image size, in a repeat

370
1
Jump to solution
04-17-2024 11:24 AM
MikeOnzay
Frequent Contributor

Is it possible to compare image sizes using an if statement in a repeat based on an image question with an appearance of multiline? Most photos are taken in landscape mode but sometimes it is in portrait. I don't want to squish the portrait photos.

${#photos}

${if $file | getValue:"height" > $file | getValue:"width"} ${$file | size:400:600} ${/}

${if $file | getValue:"width" > $file | getValue:"height"} ${$file | size:600:400} ${/}

${/}

Usually, I get this error when uploading the template:

Error: An error occurred when checking the report template. The end tag ${/} is unopened.

Sometimes it loads but fails on the generating of the report:

An error occurred when rendering by the report engine. Failed to parse ${if $file | getValue:"height" > $file | getValue:"width"} since it is an invalid expression.

 

 

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

I don't believe this is a supported operation. Cool idea though.

When specifying a photo's height width, there are two things to consider: 1) width x height, and 2) max width x max height. [See Images and other attachments]

Right now, you have width x height specified. Have you tried specifying a max? E.g.,

${image1 | size:0:0:600:600}

View solution in original post

1 Reply
abureaux
MVP Frequent Contributor

I don't believe this is a supported operation. Cool idea though.

When specifying a photo's height width, there are two things to consider: 1) width x height, and 2) max width x max height. [See Images and other attachments]

Right now, you have width x height specified. Have you tried specifying a max? E.g.,

${image1 | size:0:0:600:600}