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

Merge pull request !368 from zgf/master
This commit is contained in:
openharmony_ci 2024-08-23 09:45:04 +00:00 committed by Gitee
commit 6612dea1d5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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 ## 3.1.0-rc.2
- 修复宽高不等svg图片显示有毛边 - 修复宽高不等svg图片显示有毛边

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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"), placeholderSrc:$r("app.media.loading"),
errorholderSrc:$r("app.media.failed"), errorholderSrc:$r("app.media.failed"),
objectFit: ImageFit.Auto, objectFit: ImageFit.Auto,
border: {radius:50} border: {radius:50},
transformation:new BlurTransformation(5)
})}) })})
} }
.width(56).height(56) .width(56).height(56)

View File

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

View File

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