[File Manager] Working with metadata in custom backend

I’m trying to implement a custom back-end and the standard getMeta function is not working for me so I have to overwrite it in the child class. My getMeta function looks like so:

getMeta(obj) {
    return new webix.promise((resolve, reject) => {
        resolve({ ImageWidth: 0, ImageHeight: 0 });
    });
}

Also, here is a code snippet with similar code:

https://snippet.webix.com/o4antwp7

Do I need to include more than just ImageWidth and ImageHeight in the meta object? Or am I not making the promise right? Or is there something else that I am not doing correctly?

It’s mostly right but for a few issues with the default logic:

  1. values inside the object that getMeta returns must be strings (because the backend lib we used returns strings)
  2. not equal “0” (showing zeros is probably not very informative)

https://snippet.webix.com/w9fjuuzy

To admit and show any values including “0” and 0 in meta data, you can redefine SetExtraInfo and the template of Extra info (remove .trim() that is called on each value; also remove value != "0" and check for undefined rather that for a truthy value)

https://snippet.webix.com/12mvivjf