Best way to keep aspect ratio?

Questions and answers on how to get the most out of FFAStrans
buddhabas
Posts: 19
Joined: Tue Oct 04, 2022 9:03 pm

Re: Best way to keep aspect ratio?

Post by buddhabas »

emcodem wrote: Mon Dec 16, 2024 6:34 pm after reading your workflow from PM (thanks!), i sense the only problem you have is a wrong function name. You have $roundd but you need $round instead. Found a typo in documentation and notified steinar for correction of the same.
It's not a typo. There are 3 similar functions:
https://www.ffastrans.com/wiki/doku.php ... _functions
Last edited by buddhabas on Mon Dec 16, 2024 7:10 pm, edited 1 time in total.
emcodem
Posts: 1815
Joined: Wed Sep 19, 2018 8:11 am

Re: Best way to keep aspect ratio?

Post by emcodem »

You are faster than steinar :D
Anyway, it seemed to work with $round instead of $roundd...
Try in a populate processor, set s_success to:

$roundd(409/2,0)*2
dont work

$round(409/2,0)*2
works

$roundu(409/2,0)*2
dont work

when you change the number to "2.0" or "2" instead of "2,0", all 3 functions work.
A short talk to steinar revealed that in his post before, the comma was intended to be actually a parameter to the roundd function but it does not take parameters(anymore?)... the old post is now corrected to avoid future users errors.
So after all, the real issue with this all is that $round does take a second argument, thus it reacts to 2,0 (treating 0 as second arg), while $roundd does not support an argument thus it just fails.

By pure accident, i was right that we need to update the inbuilt documentation because $roundd is documented with this example but it does acutally not take a 2nd parameter.
$roundd(number to round =number/%f_variable%[, number of output decimals = integer/%i_variable%])
:D
emcodem, wrapping since 2009 you got the rhyme?
buddhabas
Posts: 19
Joined: Tue Oct 04, 2022 9:03 pm

Re: Best way to keep aspect ratio?

Post by buddhabas »

emcodem wrote: Mon Dec 16, 2024 6:49 pm You are faster than steinar :D
Anyway, it seemed to work with $round instead of $roundd...
Try in a populate processor, set s_success to:

$roundd(409/2,0)*2
dont work

$round(409/2,0)*2
works

$roundu(409/2,0)*2
dont work

when you change the number to "2.0" or "2" instead of "2,0", all 3 functions work.
A short talk to steinar revealed that in his post before, the comma was intended to be actually a parameter to the roundd function but it does not take parameters(anymore?)... the old post is now corrected to avoid future users errors.
So after all, the real issue with this all is that $round does take a second argument, thus it reacts to 2,0 (treating 0 as second arg), while $roundd does not support an argument thus it just fails.

By pure accident, i was right that we need to update the inbuilt documentation because $roundd is documented with this example but it does acutally not take a 2nd parameter.
$roundd(number to round =number/%f_variable%[, number of output decimals = integer/%i_variable%])
:D
Thanks so much guys. It does work! :)
Post Reply