Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| src | String | Yes | Image path: network image URL, apFilePath, or relative path |
| success | Function | No | Callback with image info |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Success Callback
| Property | Type | Description |
|---|---|---|
| width | Number | Image width in pixels |
| height | Number | Image height in pixels |
| path | String | Local path to image |
| orientation | String | Image orientation (see below) |
| type | String | Image format |
orientation Values
| Value | Description |
|---|---|
up | Default |
down | 180-degree rotation |
left | Rotated 90 degrees counterclockwise |
right | Rotated 90 degrees clockwise |
up-mirrored | Same as up, flipped horizontally |
down-mirrored | Same as down, flipped horizontally |
left-mirrored | Same as left, flipped vertically |
right-mirrored | Same as right, flipped vertically |
Code Example
my.getImageInfo({
src: 'https://example.com/image.jpg',
success: (res) => {
console.log('Size:', res.width, 'x', res.height);
}
});