Skip to main content
Use this API to retrieve width, height, and other metadata about an image.

Parameters

PropertyTypeRequiredDescription
srcStringYesImage path (local or remote)
successFunctionNoCallback with image info
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

PropertyTypeDescription
widthNumberImage width in pixels
heightNumberImage height in pixels
pathStringLocal path to image
orientationStringImage orientation
typeStringImage format

Code Example

my.getImageInfo({
  src: 'https://example.com/image.jpg',
  success: (res) => {
    console.log('Size:', res.width, 'x', res.height);
  }
});