修改webp图片区分动静图和错误图加载完未发起排队队列中的请求

Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
zgf 2024-08-23 17:28:50 +08:00
parent ad18fe60b2
commit fae5b3c7fd
4 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
## 3.1.0-rc.3
- 部分静态webp图片有delay属性导致识别成动图,改用getFrameCount识别
- 修复加载错误图后未去请求排队队列中的请求
## 3.1.0-rc.2
- 修复宽高不等svg图片显示有毛边

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ImageKnifeComponent,ImageKnifeOption } from '@ohos/libraryimageknife';
import { BlurTransformation, ImageKnifeComponent,ImageKnifeOption } from '@ohos/libraryimageknife';
@ -43,7 +43,8 @@ struct ManyPhotoShowPage {
placeholderSrc:$r("app.media.loading"),
errorholderSrc:$r("app.media.failed"),
objectFit: ImageFit.Auto,
border: {radius:50}
border: {radius:50},
transformation:new BlurTransformation(5)
})})
}
.width(56).height(56)

View File

@ -14,7 +14,7 @@
"main": "index.ets",
"repository": "https://gitee.com/openharmony-tpc/ImageKnife",
"type": "module",
"version": "3.1.0-rc.2",
"version": "3.1.0-rc.3",
"dependencies": {
"@ohos/gpu_transform": "^1.0.2"
},

View File

@ -263,6 +263,7 @@ export class ImageKnifeDispatcher {
}
});
this.executingJobMap.remove(memoryKey);
this.dispatchNextJob();
return;
}
// 保存文件缓存
@ -608,8 +609,8 @@ async function requestJob(request: RequestJobRequest, requestList?: List<ImageKn
}
let resPixelmap: PixelMap | undefined = undefined
if (typeValue === 'gif' || typeValue === 'webp') {
let delayList = await imageSource.getDelayTimeList()
if(delayList == undefined) {
let frameCount = await imageSource.getFrameCount()
if(frameCount == undefined || frameCount == 1) {
} else {
let size = (await imageSource.getImageInfo()).size
let base64Help = new util.Base64Helper()