跳到主要内容

bn.getImageInfo

getImageInfo(options): Promise<ImageInfoResponse>

description Get image detail information

example

bn.getImageInfo({
src: 'https://bin.bnbstatic.com/image/julia/new-hompage/foreground-image-light.png'
}).then((info) => {
console.log(info)
})

Parameters

NameTypeDescription
optionsImageInfoRequestOptionImage options

Returns

Promise<ImageInfoResponse>

Image detail information

Interface: ImageInfoRequestOption

NameTypeDescription
srcstringImage src path, support network path, local path, code package path

Interface: ImageInfoResponse

NameTypeDescription
widthnumberImage original width in px
heightnumberImage original height in px
pathstringLocal path of Image
orientationstringDevice orientation when taking photos
typestringImage format, for example 'jpeg'