I'm writing a button script that tries to get the image format (JPEG, GIF, PNG, ...) from an image file not taking into account its file extension.
The problem is that I can't find an ImageMeta property that returns this data but I noticed that the Description column in a Lister shows a string that contains what I'm looking for,
e.g. "1920 x 1080 x 24 PNG Image"
I have found in the documentation that the Metadata.other.autodesc property should return this string but I always get undefined as a result no matter the image file I use in my tests.
Here is a snippet of my code:
function OnClick (clickData) {
DOpus.Output("\nTesting image metadata extraction...");
var selectedFiles = clickData.func.sourcetab.selected_files;
var file;
for (var fileEnum = new Enumerator(selectedFiles); !fileEnum.atEnd(); fileEnum.moveNext()) {
file = fileEnum.item();
DOpus.Output("Image file: " + file.name);
DOpus.Output(" > Description: " + file.metadata.other.autodesc);
}
}