getImageSizeFromPath(imagePath) {
        return new Promise(function getSize(resolve, reject) {
            let dimensions;

            try {
                dimensions = sizeOf(imagePath);

                if (dimensions.images) {
                    dimensions.width = _.maxBy(dimensions.images, (w) => {
                        return w.width;
                    }).width;
                    dimensions.height = _.maxBy(dimensions.images, (h) => {
                        return h.height;
                    }).height;
                }

                resolve({
                    width: dimensions.width,
                    height: dimensions.height
                });
            } catch (err) {
                reject(new errors.ValidationError({
                    message: tpl(messages.invalidDimensions, {
                        file: imagePath,
                        error: err.message
                    })
                }));
            }
        });
    }
Supported formats of https://github.com/image-size/image-size:
BMP, GIF, JPEG, PNG, PSD, TIFF, WebP, SVG, ICO
Get dimensions for a file from its real file storage path
Always returns {object} getImageDimensions
@param {string} imagePath
@returns {Promise<Object>} getImageDimensions
@description Takes a file path and returns width and height.