Skip to main content
johnrellis
Legend
March 21, 2012

P: SDK: Bug in photo:getRawMetadata ("durationInSeconds")?

  • March 21, 2012
  • 3 replies
  • 312 views

In LR 3, the field "durationInSeconds" returned by photo:getRawMetadata() is a number. But in LR 4, it's a userdata that tostring() shows as "RatioTime( 1847/6 )". Some tedious experimentation (absent documentation) shows that the method toNumber() will convert it to a number.

Was it intentional to return this field as a built-in object? I suspect that this is a bug, that the intention was to convert the RatioTime to a number before returning it to the client caller. All other SDK objects have names that start with "Lr".

This topic has been closed for replies.

3 replies

johnrellis
Legend
April 28, 2012
This is fixed in LR 4.1 RC2.
johnrellis
Legend
March 22, 2012
Thanks.
Adobe Employee
March 22, 2012
Yes it appears this call is now returning a "RatioTime." I agree this is a bug. This is fallout from new video functionality in LR4. For backwards compatibility this should return a number, not a RatioTime.

It would be nice to have a "durationInRatioTime" field as well if additional accuracy is required, but as you pointed out it shouldn't be a "RatioTime" object- probably just a table with a denominator and numerator.

I will file and track this issue. Thanks!