Thanks for the replies.
You can register a class with optional namespace for the use in the template
I saw this in the Smarty documentation too, but I don't think it applies in my situation - I don't need to use the namespace in my template, only inside the UDT.
maybe it will have to be a plugin instead
Tried this and it works! I don't understand why though - I thought anything that could be executed in a plugin could be executed in a UDT. Are there additional restrictions to the PHP that can be executed in a UDT?
Anyway, delighted to have it working.
Use the CMSMS config variables, and build an absolute path.
The require_once line is working fine - the UDT seems to fail at the "use Gregwar\Image\Image" line.
I changed to using an absolute path in the require line but the UDT still fails.