Page 1 of 1
Image size in mm
Posted: Thu Mar 31, 2022 8:27 pm
by magnussandstrom
Hi, I'm building a flow where I need to present image size
in millimetres (image files).
I tried:
Code: Select all
[Switch.Calculation:Expression="[Switch.Calculation:Expression="[Image.ImageWidth]/[Image.XResolution]"]*25.4"]x[And the same calculation for height]
But since Image.XResolution is
3000000/10000 and not 300 I doesn't get the intended result.
Any suggestions?
Re: Image size in mm
Posted: Fri Apr 01, 2022 10:13 am
by freddyp
The fact that [Image.XResolution] is 3000000/10000 is not a problem because in a calculation that results in 300. However!
Suppose the value of [Image.ImageWidth] is 6000. Your calculation becomes 6000/3000000/10000. As there are no parentheses the 6000 is divided by 3000000 first, and the result of that is divided again by 10000. That is a very small image indeed

. Place parentheses around [Image.XResolution].
Re: Image size in mm
Posted: Fri Apr 01, 2022 11:19 am
by magnussandstrom
Thanks you Freddy!
This works now:
Code: Select all
[Switch.Calculation:Expression="round([Switch.Calculation:Expression="[Image.ImageWidth]/([Image.XResolution])"]*25.4)"]x[Switch.Calculation:Expression="round([Switch.Calculation:Expression="[Image.ImageLength]/([Image.YResolution])"]*25.4)"]