Filter for lossless WebP images

Hi,
I have noticed that Directory Opus is able to distinguish between lossy and lossless WebP images.

I am trying to define a file filter subclause that selects only lossless WebP images, but I can't figure out which attribute to use to make the filter work. The Description column shows the information I am looking for in the file viewer, but the Description attribute available for filters does not contain that same information.

Am I missing something? Which attribute should I be using in my filter?

I think Description in filters may only search explicitly set description (sometimes called "User Comment"), not automatically generated ones. "Description" is an overloaded term here, unfortunately.

But if you drop this small script on to Preferences / Toolbars / Scripts or into the /scripts folder alias (type it into the path field and push return), it will add a new column available for searching which contains the same string as the automatic description column:

AutoDesc.js.txt (868 Bytes)

You can then use it in a filter like this:


For reference, this is the contents of the script file:

// Called by Directory Opus to initialize the script
function OnInit(initData)
{
	initData.name = "AutoDesc";
	initData.version = "1.0";
	initData.copyright = "(c) 2023 Leo Davidson";
	initData.url = "https://resource.dopus.com/t/filter-for-lossless-webp-images/43678";
	initData.desc = "Enables filtering on auto-generated file descriptions";
	initData.default_enable = true;
	initData.min_version = "12.0";

}

// Called to add columns to Opus
function OnAddColumns(addColData)
{
	var col = addColData.AddColumn();
	col.name = "AutoDesc";
	col.method = "OnAutoDesc";
	col.label = "AutoDesc";
	col.justify = "left";
	col.autogroup = true;
	col.autorefresh = true;
	col.namerefresh = true;
}


// Implement the AutoDesc column
function OnAutoDesc(scriptColData)
{
	scriptColData.value = scriptColData.item.metadata.other.autodesc;
}
2 Likes

Thank you Leo for your fast response and the script, it works flawlessly.

This column scripting stuff is something I have yet to learn to improve my Directory Opus skills. It seems very useful.

1 Like