Skip to main content
johnrellis
Legend
Mar 21, 2012 2:16 AM UTC
Released

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

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

johnrellis
Legend
Apr 28, 2012 4:03 AM UTC
This is fixed in LR 4.1 RC2.
Translate
johnrellis
Legend
Mar 22, 2012 5:14 PM UTC
Thanks.
Translate
Participating Frequently
Mar 22, 2012 4:59 PM UTC
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!
Translate