Setting a comment confuses the metadata object

Setting a comment via the UI (metadata pane or button) in .jpg files confuses the file's metadata object. The type switches to other and many properties will be returned as undefined. The metadata pane will still display all fields correctly. A refresh seems to help. Opus 12.23 didn't act like this.

Quick demo via CLI:

var tab = DOpus.listers.lastactive.activetab;

var item = tab.selected(0);

DOpus.Output('item                            ' + item);
DOpus.Output('item.metadata                   ' + item.metadata);
DOpus.Output('item.metadata.other.rating      ' + item.metadata.other.rating);
DOpus.Output('item.metadata.other.usercomment ' + item.metadata.other.usercomment);
DOpus.Output('item.metadata.image.datetaken   ' + item.metadata.image.datetaken);

Grab a jpg:

Add a comment and change other metadata:

Delete the comment:

I haven't been able to reproduce this so far, testing with Opus 12.24.3.

I wonder if it's specific to the type/source of jpeg and other metadata it has on it?

Could very well be the case... I used maybe a dozen different jpegs, but all from a Sony camera. I'll try a few more from other sources.

1 Like

Well, I actually didn't find a jpeg, with which I couldn't reproduce that effect. Same behaviour on my second PC. I need, however, to take back my statement about 12.23: no difference to 12.24.

Here are some sample images: 39132.zip (25.2 MB)

Thanks! I think I've worked out what's going on, and it probably also explains why you weren't seeing it before but are now, as well as why I didn't see it until now.

It depends on which columns the lister is displaying. If the comment is added/edited and no columns are turned on that cause the other metadata to be re-fetched, then the other metadata aren't cached when the script asks for the file's data. Since the comment metadata is cached, we're incorrectly assuming that's all there is and returning it on its own when the script asks, rather than causing the rest of the metadata to be calculated at that point.

We'll have a fix in the next beta.

1 Like