Can IconPathPatcher:patchPath return Data URI?

Hi,

com.intellij.openapi.util.IconPathPatcher:patchPath returns the path of an image file. This can be a resource located in resources/, or an absolute path (file://...).

I’m wondering if it also accepts a data URI like data:image/svg+xml;base64,theImageAsBase64. I tried, but it shows a 1x1 pixel only.

I need this because I have a plugin that allows users to customize IDE’s icons. I currently use file://... paths, but that means I have to create temp files first, then use their absolute path. Data URIs would be a better option as everything would stay in memory.

I’ve looked through the source code for IconPathPatcher and its implementations, but I haven’t found anything of interest yet. I’m not sure, but it’s like it doesn’t take a standard resource stream, and it accepts only resources from resources/ or file://....
Do you have any idea?

Thx

Hi!
Thanks for the question. com.intellij.ui.icons.ImageDataByFilePathLoader is in charge of loading patched icons and it unfortunately does not support data URLs. It always expects a path and ClassLoader, path gets additionally modified for _dark or x2 variants there.