判断和处理imageSource.getImageInfo为空的场景,返回错误信息
Signed-off-by: madixin <madixin@huawei.com>
This commit is contained in:
parent
f552f57713
commit
630b0df448
|
@ -1,5 +1,7 @@
|
|||
## 3.2.0
|
||||
- PixelMap size exceeds the maximum value of memory cache and is not cached
|
||||
- Fix bug: PixelMap size exceeds the maximum value of memory cache and is not cached
|
||||
- Dealing with exception scenarios where imageSource.getImageInfo return undefined
|
||||
|
||||
## 3.2.0-rc.2
|
||||
- Added callback information for image loading
|
||||
- Added the interface for obtaining the upper limit and size of the current cache and the number of images corresponding to the current cache
|
||||
|
|
|
@ -123,7 +123,12 @@ export class ImageKnifeLoader {
|
|||
return
|
||||
}
|
||||
|
||||
let size = (await imageSource.getImageInfo()).size
|
||||
let imageInfoSync = imageSource.getImageInfoSync()
|
||||
if (imageInfoSync == undefined){
|
||||
ImageKnifeLoader.makeEmptyResult(request, "Fail to get image info of imageSource")
|
||||
return
|
||||
}
|
||||
let size = imageInfoSync.size
|
||||
callBackData.imageWidth = size.width;
|
||||
callBackData.imageHeight = size.height;
|
||||
try {
|
||||
|
@ -194,7 +199,12 @@ export class ImageKnifeLoader {
|
|||
return
|
||||
}
|
||||
|
||||
let size = (await imageSource.getImageInfo()).size
|
||||
let imageInfoSync = imageSource.getImageInfoSync()
|
||||
if (imageInfoSync == undefined){
|
||||
ImageKnifeLoader.makeEmptyResult(request, "Fail to get image info of imageSource")
|
||||
return
|
||||
}
|
||||
let size = imageInfoSync.size
|
||||
let scale = size.height / size.width
|
||||
let hValue = Math.round(request.componentHeight);
|
||||
let wValue = Math.round(request.componentWidth);
|
||||
|
@ -265,7 +275,12 @@ export class ImageKnifeLoader {
|
|||
}
|
||||
|
||||
let frameCount = await imageSource.getFrameCount()
|
||||
let size = (await imageSource.getImageInfo()).size
|
||||
let imageInfoSync = imageSource.getImageInfoSync()
|
||||
if (imageInfoSync == undefined){
|
||||
ImageKnifeLoader.makeEmptyResult(request, "Fail to get image info of imageSource")
|
||||
return
|
||||
}
|
||||
let size = imageInfoSync.size
|
||||
callBackData.frameCount = frameCount;
|
||||
callBackData.imageWidth = size.width;
|
||||
callBackData.imageHeight = size.height;
|
||||
|
|
Loading…
Reference in New Issue