Page 1 of 1
Aspect ratio
Posted: 2014-09-07 04:23:03
by al0203
I would like to make a custom field with the aspect ratio of the movies, Frame width/Frame height. AMC gives you the resolution but I don't know the functions to get the width and the height separately. Some movies has a very bad ratio and I would like to know it, to be able to correct it.
This is not a question of AMC, but maybe someone can help me. Does anyone know how can I change the details information of a file?. I found out that sometimes the information of the frame size is not correct, but I donĀ“t know how can I change it. Thank you.
Posted: 2014-09-07 12:45:31
by antp
Hi,
Such field can be filled by script :
program NewScript;
uses StringUtils1;
var
s : string;
w, h: Integer;
begin
s := GetField(fieldResolution);
w := StrToInt(TextBefore(s, 'x', ''), 1);
h := StrToInt(TextAfter(s, 'x'), 1);
SetCustomField('Ratio', FloatToStr( w / h));
end.
assuming here that the custom Ratio fiend is a text field with a tag = 'Ratio'.
You could also set a float field with a fixed number of decimal, in such case you can remove the 'FloatToStr' function call.
Posted: 2014-09-08 08:03:19
by al0203
antp wrote:Hi,
Such field can be filled by script :
program NewScript;
uses StringUtils1;
var
s : string;
w, h: Integer;
begin
s := GetField(fieldResolution);
w := StrToInt(TextBefore(s, 'x', ''), 1);
h := StrToInt(TextAfter(s, 'x'), 1);
SetCustomField('Ratio', FloatToStr( w / h));
end.
assuming here that the custom Ratio fiend is a text field with a tag = 'Ratio'.
You could also set a float field with a fixed number of decimal, in such case you can remove the 'FloatToStr' function call.
Thank you.
Another small question, where can I find the catalog of all the functions like the exponencial? Sqrt works but I don't know how to put a power like 5^3.
Posted: 2014-09-08 09:51:59
by antp
Power(5, 3)
Like in Pascal/Delphi. Not all functions are documented, when they are basic Pascal functions.
Posted: 2014-09-08 10:13:38
by al0203
antp wrote:Power(5, 3)
Like in Pascal/Delphi. Not all functions are documented, when they are basic Pascal functions.
I already tried power (5,3) and it gives me error "unknown identifier: POWER in line 17". I wrote
ponde:= power(5,3);
and ponde is a real variable.
Posted: 2014-09-08 12:41:55
by antp
I guess that the function isn't linked to the script engine then.
Only solution would be a for-loop ...
for i := 1 to Exponent do
begin
Value := Value * Base;
end;